Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Support ES6 UnicodeEscapeSequence in Identifiers #5291

Closed
rbuckton opened this issue Oct 16, 2015 · 0 comments · Fixed by #32725
Closed

Support ES6 UnicodeEscapeSequence in Identifiers #5291

rbuckton opened this issue Oct 16, 2015 · 0 comments · Fixed by #32725
Labels
ES6 Relates to the ES6 Spec Help Wanted You can do this Suggestion An idea for TypeScript
Milestone

Comments

@rbuckton
Copy link
Member

Per section 11.6 of the ES6 spec:

Unicode escape sequences are permitted in an IdentifierName, where they contribute a single Unicode code point to the IdentifierName. The code point is expressed by the HexDigits of the UnicodeEscapeSequence (see 11.8.4). The \ preceding the UnicodeEscapeSequence and the u and { } code units, if they appear, do not contribute code points to the IdentifierName. A UnicodeEscapeSequence cannot be used to put a code point into an IdentifierName that would otherwise be illegal. In other words, if a \ UnicodeEscapeSequence sequence were replaced by the SourceCharacter it contributes, the result must still be a valid IdentifierName that has the exact same sequence of SourceCharacter elements as the original IdentifierName. All interpretations of IdentifierName within this specification are based upon their actual code points regardless of whether or not an escape sequence was used to contribute any particular code point.

Two IdentifierName that are canonically equivalent according to the Unicode standard are not equal unless, after replacement of each UnicodeEscapeSequence, they are represented by the exact same sequence of code points.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
ES6 Relates to the ES6 Spec Help Wanted You can do this Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants