[DJSON-11] Commas still don't work properly in all cases for removed values via value-fn Created: 16/May/13 Updated: 02/Aug/13 Resolved: 02/Aug/13
|Patch:||Code and Test|
DSON-7 fixes the problem with printing JSON with extra commas, but only as long as the last item is actually printable (the test doesn't appear to demonstrate this, but the keys are iterated in hash order, not insertion order). If the last item's no good, we still have a problem.
The best way to handle this without trying to precalculate value-fn for the next value (in case it's not needed) is to insert the comma BEFORE we print the current value, but only if it's not the first thing to be printed.
|Comment by Andy Fingerhut [ 17/May/13 8:33 AM ]|
Doh! Patch djson-11-fix-comma-printing-patch-v1.txt dated May 17 2013 should really fix things, including changing the test to exhibit the problem (before this fix).
|Comment by Stuart Sierra [ 02/Aug/13 2:55 PM ]|