This patch implements the ability to handle numbers in exponential notation within the JSON text. It also implements allowing a trailing comma after the last item in an array or object.
The JSON standard specifies that exponential notation should be supported but the JSON Lite implementation being used does not support it. I ran into this when PHP was generating data that was in exponential notation so I made this enhancement instead of dumbing down the PHP.
The trailing comma enhancement comes from my work with the Lua scripting language which implements this and I found to be a very nice feature. It allows you to always tack on a comma after an item which makes it easy to cut and paste to move items around without having to go back and delete the comma after the new last item and then add a comma after the old last item which is now in the middle of a list.
ID #2397890 - JSON Numbers in exponential notation
Built with Rev #400 dated 29 November 2008. Patches are uploaded to the SourceForge SVN at OFC2 Patch Tracker
Download a prebuilt SWF and source code on the Downloads page.
As of 6 December 2008:
JSON Deserialization Enhancements have NOT been included in OFC2
Sorry - nothing really to display on a chart for this. Here are some sample JSON text snippets that are valid with the patch but cause errors without it:
Numbers in exponential notation:
"values": [{"x":1.23345e8, "y":0.44432E-6}, {"x":3, "y":-5.88394e-3}]
Trailing comma:
"values":[1,2,4,5,3,]