mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-10 12:47:13 +00:00
Updated test and fix for gh issue #539
This commit is contained in:
committed by
Francisco Ryan Tolmasky I
parent
564399c78b
commit
d5cea283d4
@@ -153,8 +153,14 @@
|
||||
continue;
|
||||
|
||||
var value = object[key];
|
||||
|
||||
if (value == null)
|
||||
{
|
||||
[dictionary setObject:[CPNull null] forKey:key];
|
||||
continue;
|
||||
}
|
||||
|
||||
if (recursively && value != null)
|
||||
if (recursively)
|
||||
{
|
||||
if (value.constructor === Object)
|
||||
value = [CPDictionary dictionaryWithJSObject:value recursively:YES];
|
||||
|
||||
@@ -67,9 +67,9 @@
|
||||
- (void)testDictionaryWithJSObjectRecursiveWithNull
|
||||
{
|
||||
var dict = [CPDictionary dictionaryWithJSObject:json_with_nulls recursively:YES];
|
||||
[self assert:2 equals:[dict count]];
|
||||
[self assert:[@"key1", @"key2"] equals:[dict allKeys]];
|
||||
[self assert:[dict objectForKey:@"key3"] equals:nil];
|
||||
[self assert:3 equals:[dict count]];
|
||||
[self assert:[@"key1", @"key2", @"key3"] equals:[dict allKeys]];
|
||||
[self assert:[CPNull null] equals:[dict objectForKey:@"key3"]];
|
||||
}
|
||||
|
||||
- (void)testDictionaryWithJSObjectNonRecursive
|
||||
|
||||
Reference in New Issue
Block a user