Format object descriptions like object literals.

This change makes CPDictionary descriptions exactly like Objective-C literals. Later when Objective-J adds support for such literals too, it'll be possible to just copy and paste a CPDictionary description into code.

Also updated CPArray to look similar for consistency.
This commit is contained in:
Alexander Ljungberg committed 2013-01-26 12:01:20 +00:00
1 parent 237143851d
commit 75d73d3a5e
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -874,7 +874,7 @@ var concat = Array.prototype.concat,
{
var index = 0,
count = [self count],
description = "[";
description = "@[";
for (; index < count; ++index)
{
+1 -1
View File
@@ -651,7 +651,7 @@
var key = keys[index],
value = self.valueForKey(key);
string += " " + key + " = " + CPDescriptionOfObject(value).split("\n").join("\n ") + ";\n";
string += " @\"" + key + "\": " + CPDescriptionOfObject(value).split("\n").join("\n ") + (index + 1 < count ? "," : "") + "\n";
}
return string + "}";