Closed
Bug 935199
Opened 12 years ago
Closed 11 years ago
Inaccuracy on JSON documentation page
Categories
(Developer Documentation Graveyard :: JavaScript, defect)
Developer Documentation Graveyard
JavaScript
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: richard.gibson, Assigned: bruant.d)
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/28.0.1500.71 Chrome/28.0.1500.71 Safari/537.36
Steps to reproduce:
Visited https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON
Actual results:
I read "It is based upon JavaScript syntax but is distinct from it: some JavaScript is not JSON, and some JSON is not JavaScript".
Expected results:
Something more like "It is a strict subset of JavaScript syntax: not all JavaScript is JSON".
Assignee | ||
Comment 1•12 years ago
|
||
It's suggested that it's not the case because of U+2028 and U+2029
https://twitter.com/mathias/status/398002300603891712
https://twitter.com/mathias/status/398002709246533632
var code = '"\u2028\u2029"';
JSON.parse(code); // works fine
eval(code); // fails
I'm keeping the bug open, because a note should be added to explain this special case.
Reporter | ||
Comment 2•12 years ago
|
||
Perfect! Thanks.
Comment 3•11 years ago
|
||
I have added the sample from comment 1 to the page and also a link to http://timelessrepo.com/json-isnt-a-javascript-subset which explains it pretty good I would say. Feel free to review and enhance the wiki page, if you like.
Status: UNCONFIRMED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•