New issue
Advanced search Search tips

Issue 2892 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Oct 2014
HW: ----
NextAction: ----
OS: ----
Priority: ----
Type: ----



Sign in to add a comment

Update identifier syntax to disallow U+2E2F

Project Member Reported by math...@qiwi.be, Sep 18 2013

Issue description

TC39 discussed http://esdiscuss.org/topic/backwards-compatibility-and-u-2e2f-in-identifier-s and concluded that we should not deviate from Unicode because we don’t want to separate lists from Unicode.

That means `\u2E2F` and `ⸯ` need to throw when used as identifier.

This boils down to updating the script that generates the Unicode tables in `src/unicode.cc` to explicitly blacklist U+2E2F. Unfortunately this script is not open source so I couldn’t write a patch.

For reference, here’s the same issue in SpiderMonkey: https://bugzilla.mozilla.org/show_bug.cgi?id=917436
 
Generating the list based on latest Unicode should do the trick as it excludes that code point. It was included by mistake before.

Comment 3 Deleted

Comment 4 by math...@qiwi.be, Sep 18 2013

@annevankesteren:  According to ftp://ftp.unicode.org/Public/6.2.0/ucd/UnicodeData.txt, U+2E2F is still in the `Lm` category, which is allowed in ECMAScript identifiers, as per Unicode v6.2.0 (the latest version at the time of writing):

> 2E2F;VERTICAL TILDE;Lm;0;ON;;;;;N;;;;;

Comment 5 by math...@qiwi.be, Sep 18 2013

> Generating the list based on latest Unicode should do the trick as it excludes that code point. It was included by mistake before.

Just to clarify, what Anne meant is that generating the Unicode tables based on the ECMAScript 6 definition for identifiers (which pretty much defers to http://www.unicode.org/reports/tr31/) rather than the ECMAScript 5 definition for identifiers (which just lists the Unicode categories) would solve this issue.

Comment 6 by math...@qiwi.be, Oct 4 2014

CL to disallow U+2E2F: https://codereview.chromium.org/626073002/

Comment 7 by math...@qiwi.be, Oct 8 2014

Patch that updates to Unicode v7.0.0 data and uses the ES6 definition of `Identifier` except for supplementary character support: https://codereview.chromium.org/638643002/ (See  issue 3617  for follow-up.)
Status: Fixed
r24473 fixes this.
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 9 2014

The following revision refers to this bug:
  https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24

commit 8659e50723fd8a3e56c7c65e694a80d78d859c24
Author: yangguo@chromium.org <yangguo@chromium.org>
Date: Wed Oct 08 14:55:03 2014

Update unicode to 7.0.0.

And do not use code points with PATTERN_* property for identifier start.
Maintain that \u180E is a white space character.

BUG= v8:2892 
LOG=Y
R=dpino@igalia.com, mathias@qiwi.be

Review URL: https://codereview.chromium.org/638643002

git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@24473 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/BUILD.gn
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/src/char-predicates.h
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/src/jsregexp.cc
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/src/objects.h
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/src/scanner.h
[add] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/src/unicode-decoder.cc
[add] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/src/unicode-decoder.h
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/src/unicode-inl.h
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/src/unicode.cc
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/src/unicode.h
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/test/cctest/test-strings.cc
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/test/mjsunit/var.js
[add] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/test/unittests/unicode/unicode-predicates-unittest.cc
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/test/unittests/unittests.gyp
[modify] https://chromium.googlesource.com/v8/v8.git/+/8659e50723fd8a3e56c7c65e694a80d78d859c24/tools/gyp/v8.gyp

Sign in to add a comment