From 5e7125e310bf455713a17b2fd044ffbe8acf805f Mon Sep 17 00:00:00 2001 From: Alexander Ljungberg Date: Mon, 14 May 2012 19:56:42 +0100 Subject: [PATCH] Refs #1538. Clean up, accidental global. --- Foundation/CPArray/CPArray.j | 2 +- Foundation/CPObject.j | 2 +- Objective-J/CFDictionary.js | 12 ++++++------ Tests/Foundation/CPDictionaryTest.j | 2 +- Tests/Foundation/CPMutableArrayTest.j | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Foundation/CPArray/CPArray.j b/Foundation/CPArray/CPArray.j index b423ffeb7..2fba881fe 100755 --- a/Foundation/CPArray/CPArray.j +++ b/Foundation/CPArray/CPArray.j @@ -815,7 +815,7 @@ var concat = Array.prototype.concat, description += "\n"; } - return description + ')'; + return description + ")"; } // Collecting paths diff --git a/Foundation/CPObject.j b/Foundation/CPObject.j index 6703ace87..6af4622d6 100644 --- a/Foundation/CPObject.j +++ b/Foundation/CPObject.j @@ -538,7 +538,7 @@ function CPDescriptionOfObject(anObject) if (typeof(anObject) !== "object") return String(anObject); - desc = "JSObject\n{\n"; + var desc = "JSObject\n{\n"; for (var property in anObject) { diff --git a/Objective-J/CFDictionary.js b/Objective-J/CFDictionary.js index 8336920ec..99fd02fb4 100644 --- a/Objective-J/CFDictionary.js +++ b/Objective-J/CFDictionary.js @@ -136,17 +136,17 @@ DISPLAY_NAME(CFDictionary.prototype.valueForKey); CFDictionary.prototype.toString = function() { var string = "{\n", - keys = this._keys, - index = 0, - count = this._count; - + keys = this._keys, + index = 0, + count = this._count; + for (; index < count; ++index) { var key = keys[index]; - + string += "\t" + key + " = \"" + String(this.valueForKey(key)).split('\n').join("\n\t") + "\"\n"; } - + return string + "}"; }; diff --git a/Tests/Foundation/CPDictionaryTest.j b/Tests/Foundation/CPDictionaryTest.j index 82a06fe73..2760de479 100644 --- a/Tests/Foundation/CPDictionaryTest.j +++ b/Tests/Foundation/CPDictionaryTest.j @@ -15,7 +15,7 @@ "key3": { "another": "object" } - } + }; string_dict = [[CPDictionary alloc] initWithObjects:[@"1", @"2", @"This is a String", @"This is a String"] forKeys:[@"key1", @"key2", @"key3", @"key4"]]; json_dict = [CPDictionary dictionaryWithJSObject:json recursively:YES]; diff --git a/Tests/Foundation/CPMutableArrayTest.j b/Tests/Foundation/CPMutableArrayTest.j index cd88314fc..47e06311b 100644 --- a/Tests/Foundation/CPMutableArrayTest.j +++ b/Tests/Foundation/CPMutableArrayTest.j @@ -384,7 +384,7 @@ [pretty sortUsingDescriptors:[[[CPSortDescriptor alloc] initWithKey:@"value" ascending:YES]]]; - [self assert:"(\n\t0:a,\n\t1:b,\n\t2:c,\n\t3:d\n)" equals:[pretty description]] + [self assert:"(\n\t0:a,\n\t1:b,\n\t2:c,\n\t3:d\n)" equals:[pretty description]]; } - (void)testThatCPArrayDoesSortUsingTwoDescriptors