From 75d73d3a5e897bf930227cc06067f98383125f01 Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Sat, 26 Jan 2013 12:01:20 +0000 Subject: [PATCH] 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. --- Foundation/CPArray/_CPArray.j | 2 +- Foundation/CPDictionary.j | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Foundation/CPArray/_CPArray.j b/Foundation/CPArray/_CPArray.j index 2832bba8d..5154a2400 100755 --- a/Foundation/CPArray/_CPArray.j +++ b/Foundation/CPArray/_CPArray.j @@ -874,7 +874,7 @@ var concat = Array.prototype.concat, { var index = 0, count = [self count], - description = "["; + description = "@["; for (; index < count; ++index) { diff --git a/Foundation/CPDictionary.j b/Foundation/CPDictionary.j index c2199e683..7c58ff1de 100755 --- a/Foundation/CPDictionary.j +++ b/Foundation/CPDictionary.j @@ -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 + "}";