Merge pull request #1538 from mrcarlberg/cappuccino

---

Dont you hate when your logs of arrays and dictionaries display [Object object] when you have JavaScript objects in them. Now with this patch all JavaScript objects will be display with all attributes in a nice good looking way. Log CGRect, CGPoint and other JavaScript objects withour any hassle anymore. For example: console.log([myRect]);
This commit is contained in:
Alexander Ljungberg
2012-05-14 21:12:17 +01:00
parent 3525bd0183
commit bc370a2a5a
7 changed files with 74 additions and 18 deletions
+7 -9
View File
@@ -799,22 +799,20 @@ var concat = Array.prototype.concat,
{
var index = 0,
count = [self count],
description = '(';
description = "(";
for (; index < count; ++index)
{
if (index === 0)
description += '\n';
description += "\n\t";
var object = [self objectAtIndex:index],
objectDescription = object && object.isa ? [object description] : String(object);
description += "\t" + objectDescription.split('\n').join("\n\t");
var object = [self objectAtIndex:index];
description += CPDescriptionOfObject(object);
if (index !== count - 1)
description += ", ";
description += '\n';
description += ",\n\t";
else
description += "\n";
}
return description + ')';