JSON encoding and decoding of non-objects

Robert Sayre sayrer at gmail.com
Wed Oct 8 19:35:58 PDT 2008


As currently specified, the JSON functionality can produce values that
are not JSON, by calling JSON.stringify with a primitive argument. The
spec also says that JSON.parse should throw an error if the input text
does not conform to the JSON grammar.

json2.js currently seems to produce and consume strings like "4.2", as does IE8.

What gives? I feel like I'm reverse engineering IE8, which is not
supposed to be the point here.

-- 

Robert Sayre

"I would have written a shorter letter, but I did not have the time."


More information about the Es-discuss mailing list