On Aug 24, 2013, at 2:02 , Mathias Bynens <[email protected]> wrote:
> On 27 Feb 2012, at 22:58, Allen Wirfs-Brock <[email protected]> wrote:
>> var \ud87e\udc00 would probably still be illegal because each \uXXXX define
>> a separate character but: var \u{2f800} =42; schould be find as should the
>> direct none escaped occurrence of that characters.
>
> Wouldn’t this be confusing, though?
>
> global['\u{2F800}'] = 42; // would work (compatible with ES5 behavior)
> global['\uD87E\uDC00'] = 42; // would work, too, since `'\uD87E\uDC00' ==
> '\u{2F800}'` (compatible with ES5 behavior)
> var \uD87E\uDC00 = 42; // would fail (compatible with ES5 behavior)
> var \u{2F800} = 42; // would work (as per your comment; incompatible with
> ES5 behavior)
> var 丽 = 42; // would work (as per your comment; incompatible with ES5
> behavior)
I do think it's confusing that \uD87E\uDC00 is not allowed in the current ES6
spec, and have reported this as part 4 of
https://bugs.ecmascript.org/show_bug.cgi?id=501
The issue was also discussed, without a conclusion, at the TC 39 meeting in
July 2012 - look for "# Unicode support":
https://mail.mozilla.org/pipermail/es-discuss/2012-July/024207.html
> Using astral symbols in identifiers would be backwards incompatible, even if
> the raw (unescaped) symbol is used. There’d be no way to use such an
> identifier in an ES5 environment. Is this a problem?
It's the same problem as when using
let a = 42;
You should not expect that a program using new ES6 features will run on ES5
implementations (although it might run on some that have already added the ES6
features used).
Norbert
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss