Bug 90678 - JavaScript: Drop the “escaped reserved words as identifiers” compatibility measure
: JavaScript: Drop the “escaped reserved words as identifiers” compatibility me...
Status: UNCONFIRMED
: WebKit
JavaScriptCore
: 528+ (Nightly build)
: Unspecified Unspecified
: P2 Normal
Assigned To:
: http://mathias.html5.org/specs/javasc...
: InRadar
:
:
  Show dependency treegraph
 
Reported: 2012-07-06 05:44 PST by
Modified: 2013-12-12 13:22 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2012-07-06 05:44:25 PST
For example, `var var;` throws a syntax error, but e.g. `var v\u0061r;` works fine, currently. This is a violation of the ECMAScript 5.1 spec, and used to be a compatibility requirement: http://mathias.html5.org/specs/javascript/#escaped-reserved-words One year ago, all browsers except IE fulfilled this.

Half a year ago Firefox dropped this non-standard addition (https://bugzilla.mozilla.org/show_bug.cgi?id=694360) and hasn’t seen any compatibility issues since.

Please align with Firefox and IE by removing this non-standard extension.
------- Comment #1 From 2012-07-06 05:49:28 PST -------
I’ve filed the same bug here:

* Opera/Carakan: https://bugs.opera.com/browse/DSK-369398
* Chrome/V8: http://code.google.com/p/v8/issues/detail?id=2222
------- Comment #2 From 2012-07-06 19:30:50 PST -------
<rdar://problem/11824059>
------- Comment #3 From 2012-07-07 01:19:16 PST -------
See also: bug 42471.
------- Comment #4 From 2012-07-07 10:15:08 PST -------
(In reply to comment #3)
> See also: bug 42471.

Note that bug 42471 deals with IdentifierNames, while this bug (90678) is about Identifiers. Identifiers are IdentifierNames that are not reserved words.
------- Comment #5 From 2012-07-09 02:04:09 PST -------
See also: https://bugs.ecmascript.org/show_bug.cgi?id=277
------- Comment #6 From 2013-09-18 00:30:14 PST -------
FWIW, https://bugs.ecmascript.org/show_bug.cgi?id=277 is accepted, and Allen says he will make it clear (in ES6) that escaped reserved words are not allowed. The same goes for escaped regular expression flags.

Now would be a good time to drop this non-standard behavior that is apparently not a backwards compatibility concern.
------- Comment #7 From 2013-12-12 04:13:52 PST -------
Confirmed: ES6 drops the “escaped reserved words as identifiers” compatibility measure.

This will be fixed in v8: https://code.google.com/p/v8/issues/detail?id=2222#c4
SpiderMonkey already has ES6-compliant behavior: https://bugzilla.mozilla.org/show_bug.cgi?id=744784