Search the web
Sign In
New User? Sign Up
json · JSON JavaScript Object Notation
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Potential bug in JSON.parse when parsing backslashes?   Message List  
Reply | Forward Message #1288 of 1408 |
Re: [json] Potential bug in JSON.parse when parsing backslashes?

cosmicrealms scripsit:
> Code: JSON.parse("\"T\\wo\"");
>
> In Firefox 3.5 and the latest json2.js from json.org this results in
> a parse exception SyntaxError.

The interpretation of string escaping means that "\"T\\wo\"" is the
external representation of a six-character string containing quote-T-
backslash-w-o-quote. Asking JSON to parse that involves asking it
to do something with the sequence backslash-w, which is not valid JSON.
Therefore an error should result.

--
Values of beeta will give rise to dom! John Cowan
(5th/6th edition 'mv' said this if you tried http://www.ccil.org/~cowan
to rename '.' or '..' entries; see cowan@...
http://cm.bell-labs.com/cm/cs/who/dmr/odd.html)



Mon Jun 29, 2009 6:48 pm

johnwcowan
Online Now Online Now
Send Email Send Email

Forward
Message #1288 of 1408 |
Expand Messages Author Sort by Date

Code: JSON.parse("\"T\\wo\""); In Firefox 3.5 and the latest json2.js from json.org this results in a parse exception SyntaxError. Expected: Two It works in: *...
cosmicrealms
Offline Send Email
Jun 29, 2009
5:53 pm

... \w is not present in the JSON grammar. An implementation may produce a syntax error. The behavior of Firefox 3.5 is correct....
Douglas Crockford
douglascrock...
Offline Send Email
Jun 29, 2009
6:00 pm

... The interpretation of string escaping means that "\"T\\wo\"" is the external representation of a six-character string containing quote-T- ...
John Cowan
johnwcowan
Online Now Send Email
Jun 29, 2009
6:48 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help