[whatwg] Native JSON parsing API

On Jun 14, 2008, at 11:08, Adam Barth wrote:

> For example, Firefox 3 implements a native JSON
> parser <http://developer.mozilla.org/en/docs/nsIJSON>, but only for
> privileged JavaScript.  The JSON format itself is already specified.


The de jure spec for JSON, RFC 4627, doesn't specify error handling on  
the level one would expect from a WHATWG spec. Instead, the RFC says:  
"A JSON parser MAY accept non-JSON forms or extensions."
http://www.ietf.org/rfc/rfc4627.txt

The JSON parsers I've used in non-browser contexts have been Draconian  
and incompatible with existing content such as output from  
del.icio.us, which can contain escaped single quotes, which isn't  
allowed in proper JSON.

-- 
Henri Sivonen
hsivonen at iki.fi
http://hsivonen.iki.fi/

Received on Sunday, 15 June 2008 23:12:12 UTC