| Issue 52: | CJSONSerializer serializeArray doesn't correctly handle arrays with the same instances in certain places. | |
| 2 people starred this issue and may be notified of changes. | Back to list |
What steps will reproduce the problem?
Create an array that contains the same instance somewhere in the middle and
as the final element, e.g.,
NSString* a = @"a";
NSArray* array = [NSArray arrayWithObjects:a, @"b", a, nil];
What is the expected output? What do you see instead?
If that array is serialized, it should look like this:
["a","b","a"]
but it looks like this:
["a""b","a"]
The check to see if the last element of the array is serialized, and this,
if a "," string should be appended or not, is not reliable. "theValue" can
be the same as the last object, even though it isn't the last element in
the array.
This bug is present in revision 162 of the file.
May 16, 2009
Thanks for the patch & unit test. Looks good to me.
Status:
Fixed
|
1.3 KB View Download