W3C home > Mailing lists > Public > whatwg@whatwg.org > June 2008

[whatwg] Native JSON parsing API

From: Henri Sivonen <hsivonen@iki.fi>
Date: Mon, 16 Jun 2008 09:12:12 +0300
Message-ID: <3B3AB4E6-30B9-4B94-A9E6-8AD6F4AA8C85@iki.fi>
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."

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
Received on Sunday, 15 June 2008 23:12:12 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:03 UTC