New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 1958 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner:
User never visited
Closed: Feb 2012
Cc:
HW: ----
NextAction: ----
OS: ----
Priority: ----
Type: Bug
ES5



Sign in to add a comment

SyntaxError: Unexpected token ILLEGAL` when using a valid JavaScript identifiers

Project Member Reported by math...@qiwi.be, Feb 17 2012

Issue description

According to http://es5.github.com/x7.html#x7.6 (spec), http://mathiasbynens.be/notes/javascript-identifiers (summary), and http://mothereff.in/js-variables#a%5Cu200d (validator), `a\u200d` is a valid JavaScript identifier. 

However, JavaScriptCore doesn’t seem to support it:

    var a\u200d; // throws SyntaxError: Unexpected token ILLEGAL

I believe this is a spec violation.
 
js-identifier-bug.html
187 bytes View Download

Comment 1 by math...@qiwi.be, Feb 17 2012

s/JavaScriptCore/v8/. (This is copypasta from https://bugs.webkit.org/show_bug.cgi?id=78908, as v8 has the same bug.)

Comment 2 by math...@qiwi.be, Feb 17 2012

This one should be allowed too:

    var Ꙭൽↈⴱ;

Comment 3 by math...@qiwi.be, Feb 19 2012

This one should be allowed too as of Unicode 6.1.0: http://mothereff.in/js-variables#%5Cu0cf1

    var \u0cf1;

Comment 4 by math...@qiwi.be, Feb 21 2012

In case another example is needed: http://mothereff.in/js-variables#%5Cua7aa

    var \ua7aa;

Comment 5 by lrn@chromium.org, Feb 21 2012

Labels: Type-Bug ES5
Status: Accepted
V8 currently uses Unicode version 5.0.0. It does not attempt to match changes in 6.1.0.

Still, it should accept U+200D (and U+200C) since they are mentioned specifically in the specification. 
(I haven't checked what characters the other examples here are using).

Comment 6 by math...@qiwi.be, Feb 21 2012

The other examples were all Unicode 6 characters. Should I open a separate ticket for Unicode 6.1.0 support?

Comment 7 by lrn@chromium.org, Feb 21 2012

I think that's a good idea.
We had <http://code.google.com/p/v8/issues/detail?id=771>, but it would be fine to have a feature request for a newer Unicode version that is just that.

The ZWJ and ZWNJ characters are Unicode version independent, since they are in the ES5 spec by name, so let's keep this bug about them.

Comment 8 by math...@qiwi.be, Feb 21 2012

Filed  issue 1965 .

Comment 10 by lrn@chromium.org, Feb 23 2012

Owner: lrn@chromium.org
Status: Fixed
Summary: SyntaxError: Unexpected token ILLEGAL` when using a valid JavaScript identifiers
Fixed in r10800.
Thank you for the patch.

Sign in to add a comment