mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-23 19:00:41 +00:00
Object description formatting
- Made CPDescriptionOfObject smarter about detecting CG objects - CPObject, CPArray, CPDictionary do a better (as in perfect) job of indenting nested objects - CPDictionary is displayed using Cocoa-style key = value; notation
This commit is contained in:
@@ -874,18 +874,20 @@ var concat = Array.prototype.concat,
|
||||
{
|
||||
var index = 0,
|
||||
count = [self count],
|
||||
description = "@[";
|
||||
description = "[";
|
||||
|
||||
for (; index < count; ++index)
|
||||
{
|
||||
if (index === 0)
|
||||
description += "\n\t";
|
||||
description += "\n";
|
||||
|
||||
var object = [self objectAtIndex:index];
|
||||
description += CPDescriptionOfObject(object);
|
||||
|
||||
if (index !== count - 1)
|
||||
description += ",\n\t";
|
||||
// NOTE: replace(/^/mg, " ") inserts 4 spaces at the beginning of every line
|
||||
description += CPDescriptionOfObject(object).replace(/^/mg, " ");
|
||||
|
||||
if (index < count - 1)
|
||||
description += ",\n";
|
||||
else
|
||||
description += "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user