archives

« Bugzilla Issues Index

#2131 — Keywords vs unicode escapes in IdentifierName


+++ This bug was initially created as a clone of Bug #277 +++

Section 7.6 isn't particularly clear on whether identifier names with unicode escapes can be treated as keywords. The only respective text is the sentence "All interpretations of identifiers within this specification are based upon their actual characters regardless of whether or not an escape sequence was used to contribute any particular characters." It is probably intended, but not clear, that this overrides/amends the formal grammar definition.

Implementations differ in their interpretation. For example,

v\u0061r x = 0
eval("v\\u0061r y = 1")

Is accepted by FF 10, rejected by V8 3.8, and JSC seems to reject the former but accepts the latter. Conversely,

var v\u0061r = 1
eval("var v\\u0061r = 2")

is rejected by FF but accepted by V8 (actually introducing a variable named "var").