Status: New
Owner: ----
New issue 1907 by mihai.ba...@gmail.com: The literal chars 0x2028 and
0x2029 should be avoided in JSON
http://code.google.com/p/v8/issues/detail?id=1907
ch = String.fromCharCode(0x2028);
a = {};
a[ch] = "foo";
json = JSON.stringify(a);
JSON.parse(json)[ch] ==> "foo", expected
so far so good, but:
new Function("return(" + json + ")")()[ch]
==> SyntaxError: Unexpected token ILLEGAL
This is not a *bug* by specifications, but I find it quite annoying because
the JSON cannot be used literally in a JS program, making JSON.stringify
pretty useless for my case.
It would be very convenient if JSON.stringify avoids the literal 0x2028 and
0x2029 Unicode chars and outputs \u2028 and \u2029 instead.
--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev