[whatwg] Native JSON parsing API

Henri Sivonen hsivonen at iki.fi
Sun Jun 15 23:12:12 PDT 2008


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/





More information about the whatwg mailing list