Updates:
        Status: WorkingAsIntended

Comment #1 on issue 3009 by [email protected]: JSON.parse('{ "i": ["\\.s"] }') is crashing
http://code.google.com/p/v8/issues/detail?id=3009

Because both JSON and JavaScript require you to escape backslashes.

"\.s" is not a valid JSON string, hence not valid input to JSON.parse(); "\\.s" is.

In common programming languages including JavaScript, backslashes in string literals must again be escaped. To get the string "\\.s" in your program, you must write "\\\\.s" in your source code; the parser (in this case V8) will strip away one level of escaping.

Want even more fun? Write the same one-liner as a command-line argument in bash:

$ out/ia32.release/d8 -e "print(JSON.parse('{\"i\": [\"\\\\\\\\.s\"]}').i)"
\.s


(Also, a SyntaxError is not a crash.)

--
You received this message because this project is configured to send all issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to