Re: Potential bug in JSON.parse when parsing backslashes?
- --- In firstname.lastname@example.org, "cosmicrealms" <robert@...> wrote:
>\w is not present in the JSON grammar. An implementation may produce a syntax error. The behavior of Firefox 3.5 is correct.
> 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
- cosmicrealms scripsit:
> Code: JSON.parse("\"T\\wo\"");The interpretation of string escaping means that "\"T\\wo\"" is the
> In Firefox 3.5 and the latest json2.js from json.org this results in
> a parse exception SyntaxError.
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@...