[patch][ccla] The dojo.toJson fails when the object being serialized contains nested arrays.
The dojo.toJson function on Firefox (and maybe other browsers) fails when the object being serialized contains nested arrays.
The reason is at line 100 in dojo/json.js: the 'itl' variable is never declared as a local variable, so it will be created in the global context. If the function is called recursively (which happens with nested arrays), then obviously things will go wrong since the global variable will be modified by the recursive call.
The bug occurs only when the dojo.toJson is set to the stringify function defined in dojo/json.js (for example on Firefox).
The fix is simply to add a 'var itl;' statement before the loop.
Attached patch + test
Patch by Eric Durocher (IBM, CCLA)
patch file