Updates:
        Status: WorkingAsIntended

Comment #2 on issue 616 by LasseReichsteinHolstNielsen: JSON.parse doesn't accept strings contain new lines
http://code.google.com/p/v8/issues/detail?id=616

The syntax error is correct.
Newlines are not allowed inside JSON strings (no control characters are, see, e.g.,
JsonStringCharacter production of ECMA262 5ed, section 15.2.1.1).
If you meant to parse it as a string containing the \n newline escape, the backslash needs to be escaped in the string literal (because backslashes have meaning in
JavaScript string literals too), i.e,
 JSON.parse('{ "key": "a\\nb" }');

If Firefox accepts it, it's a bug in Firefox.

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to