Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

ES6 Unicode Identifiers #214

Closed
getify opened this issue Mar 4, 2015 · 5 comments
Closed

ES6 Unicode Identifiers #214

getify opened this issue Mar 4, 2015 · 5 comments

Comments

@getify
Copy link

@getify getify commented Mar 4, 2015

The new Unicode "code point escape" form is also valid for identifiers, such as:

var \u{2B400} = 42;

As usual, @mathiasbynens has a bunch of great stuff about what makes a valid Unicode identifier in ES6 vs ES5, etc.

@marijnh
Copy link
Member

@marijnh marijnh commented Mar 4, 2015

The hard part here appears to be that we don't yet know how to distinguish >0xFFFF code points as being identifier characters.

@getify
Copy link
Author

@getify getify commented Mar 4, 2015

I believe the regex at the above link gives that answer definitively, right?

@marijnh
Copy link
Member

@marijnh marijnh commented Mar 4, 2015

So that means there are no code points above 0xffff that can be part of an identifier? (This is entirely possible, I just don't know)

@mathiasbynens
Copy link
Contributor

@mathiasbynens mathiasbynens commented Mar 4, 2015

New blog post that documents the differences between ES5 and ES6 identifiers, with examples: https://mathiasbynens.be/notes/javascript-identifiers-es6 It answers your question, @marijnh.

marijnh added a commit that referenced this issue Mar 4, 2015
We still can't properly recognize code points as ES6-style
identifier chars.

Issue #214
@marijnh
Copy link
Member

@marijnh marijnh commented Mar 4, 2015

Right, so that puts us in a bit of a bind -- including another giant regexp (even bigger than the old ones -- some 14k) in the library to handle obscure identifier names is not a very attractive idea. But not being able to properly identify ES6 identifiers is also a shame.

Attached patch solves the issue reported here. The ES6 identifier issue is now tracked in #215

@marijnh marijnh closed this Mar 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants