Status: Untriaged
Owner: ----
New issue 4185 by [email protected]: Invalid Identifiers Incorrectly Permitted
https://code.google.com/p/v8/issues/detail?id=4185
V8 allows for the use of invalid identifiers when at least one character is
encoded using a unicode escape sequence. For example:
$ d8 -e 'var instanceo\u0066;'
$ echo $?
0
Expected: SyntaxError
Actual: Successful declaration of variable named `instanceof`
In both ES5 and ES6 (below), the reserved word restriction is applied to
IdentifierName, so reserved words should not be allowed regardless of how
they
are encoded.
Version: 8c57b2e16d11af541a64ef876ff2133cdd444233 (Fri Jun 12 08:22:29 2015
-0700)
OS: Ubuntu Linux
Architecture: x64
# ES5 7.6 Identifier Names and Identifiers
Identifier ::
IdentifierName but not ReservedWord
IdentifierName ::
IdentifierStart
IdentifierName IdentifierPart
IdentifierStart ::
UnicodeLetter
$
_
\ UnicodeEscapeSequence
IdentifierPart ::
IdentifierStart
UnicodeCombiningMark
UnicodeDigit
UnicodeConnectorPunctuation
<ZWNJ>
<ZWJ>
UnicodeLetter
any character in the Unicode categories “Uppercase letter (Lu)”,
“Lowercase
letter (Ll)”, “Titlecase letter (Lt)”, “Modifier letter (Lm)”, “Other
letter (Lo)”, or “Letter number (Nl)”.
https://es5.github.io/#x7.6
# ES6 11.6 Names and Keywords
IdentifierName ::
IdentifierStart
IdentifierName IdentifierPart
IdentifierStart ::
UnicodeIDStart
$
_
\ UnicodeEscapeSequence
IdentifierPart ::
UnicodeIDContinue
$
_
\ UnicodeEscapeSequence
<ZWNJ>
<ZWJ>
UnicodeIDStart ::
any Unicode code point with the Unicode property “ID_Start”
UnicodeIDContinue ::
any Unicode code point with the Unicode property “ID_Continue”
https://people.mozilla.org/~jorendorff/es6-draft.html#sec-names-and-keywords
--
You received this message because this project is configured to send all
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.