JSON parser grammar

Douglas Crockford douglas at crockford.com
Tue Jun 22 18:06:44 PDT 2010

On 6/22/2010 5:28 PM, Garrett Smith wrote:
> Most of the questions on Grammar were answered in this thread,
> however, the question of  U+0009 as a JSONStringCharacter remains. All
> major browsers allowi U+0009 in JSONString. What should the capability
> test check? If all major browsers parse without error '  "\t"  ' to
> result in a string with the character U+0009, then the feature test
> can detect that failing and use the fallback.
> JSON.parse accepting U+0009 in strings is now part of public API and
> major libraries rely on that. Is going to be codified?
> To summarize, the pressing questions are:
> 1) Is the spec going to change to allow U+0009? And if it isn't, why not? and
> 2) What should the fallback for JSON.parse use? Should it:
>   (a) go by the letter of the spec and perform a capability test to
> expect that an error is thrown for JSON.parse('  "\t"  '), or
>   (b) go with what seems to be a de facto standard and allow U+0009 as
> JSONStringCharacter?
This has already been asked and answered. We are going with a strict 
interpretation of the JSON standard.

More information about the es-discuss mailing list