more JSON spec questions

Luke Smith lsmith at
Wed Aug 26 15:49:22 PDT 2009

I shared this on the JSON Yahoo! group list, but this seems relevant  
here, now.  I extracted tests from the YUI JSON test suite for Native  
JSON support.

Great to see the sharing of tests!

On Aug 26, 2009, at 3:37 PM, Oliver Hunt wrote:

>> 2) The grammar and an existing test in the test suite  
>> disallows final commas in array input (JSON.parse('[1,]') should  
>> apparently throw) - IE8, Safari 4 and Firefox 3.5 all seem to  
>> happily accept it though, as does the yet-to-go-public Opera  
>> implementation. I'd like some reassurance from other browser  
>> vendors that you consider this a bug and intend to fix it before I  
>> push for a fix here because this is the kind of thing that might  
>> cause compat problems :-o (Guess this is more a question for the  
>> implementers on the list than for the spec authors.)
> This is definitely a bug in the WebKit implementation (we disallow  
> the trailing comma in object literals, i'm saddened that we allow  
> the trailing comma in [] :-/ )
>> 4) (Editorial) - spec says "The abstract operation Str(key, holder)  
>> has access  to
>> PropertyList and ReplacerFunction" - the algorithm does not  
>> actually use
>> PropertyList (very trivial issue, of course)
> PropertyList is used in the abstract function JO
>> Quick word about the test suite: it's current home is 
>>  where you can have a look at the README, load runner.htm to run  
>> all tests (Warning: if you do that in IE8 something makes it eat  
>> all your memory and make the PC entirely unusable!) or browse  
>> through folders to individual tests. Hope it's useful to all you  
>> implementers out there. Feedback welcome :)
> There are also reasonably extensive tests in the WebKit repository  
> -- unfortunately they are designed primarily as regression tests so  
> their output isn't astonishingly nice -- Browsers without a native  
> JSON implementation just fail everything somewhat catastrophically  
> with no obvious indication as to why.  That said the tests do cover  
> most edge cases (although not the [] with terminating comma thing  
> apparently :-( ) such as order of execution, number of times  
> properties are accessed, etc.
>  (this one takes quite a while)
> --Oliver
> _______________________________________________
> es-discuss mailing list
> es-discuss at

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the es-discuss mailing list