From: Trans <tra...@gm...> - 2012-08-08 23:18:33
|
---------- Forwarded message ---------- From: Brendan Eich <br...@mo...> Date: Wed, Aug 8, 2012 at 2:17 PM Subject: Re: Hash style comments To: Russell Leggett <rus...@gm...> Cc: es-...@mo... Pedantry alert: someone noticed that JSON does not treat U+2028 and U+2029 (line terminators in JS) as space characters. So these can occur (unescaped) in JSON string literals, but not in JS string literals. Therefore JSON accepts sentences not legal in JS: js> JSON.parse('{"a":"\u2028","b":2}') ({a:"\u2028", b:2}) js> eval('({"a":"\u2028","b":2})') typein:11: SyntaxError: unterminated string literal: typein:11: ({"a":"( typein:11: ......^ Does YAML treat U+2028 and U+2029 the same as JSON does, or as JS does? /be |