On Tue, Aug 25, 2009 at 9:32 AM, Hallvord R. M. Steen <[email protected]>wrote:
> > This apparently makes numbers like "1." illegal? >> > [...] > > I suggest that the spec is changed. [...] > > I suggest this change because the browser implementations seem to align on > allowing this. > While the JSON spec itself allows parsers to accept strings outside the standard JSON grammar, the ES5 spec for the JSON object was carefully constructed to give us a validating parser: one that rejects non-JSON text. I would like to preserve this property, as it is what justified the need for adding a new JSON primitive to JavaScript. Without a new primitive, the best that JS code has been able to do efficiently is json2.js and json_sans_eval.js. The first being too dangerous as it guards an eval with delicate complex regular expressions no one understands. The second is about as fast but is non-validating. If a safe efficient non-validating parser were adequate we wouldn't need a new primitive. -- Cheers, --MarkM
_______________________________________________ es-discuss mailing list [email protected] https://mail.mozilla.org/listinfo/es-discuss

