Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(913)

Issue 706263002: Implement ES6 unicode escapes. (Closed)

Created:
6 years, 1 month ago by marja
Modified:
6 years ago
CC:
v8-dev
Project:
v8
Visibility:
Public.

Description

Implement ES6 unicode escapes. OBSOLETE; pls look at the split CLs instead: part 1: https://codereview.chromium.org/716423002/ BUG=v8:3648 LOG=N

Patch Set 1 #

Patch Set 2 : . #

Total comments: 15

Patch Set 3 : oops #

Patch Set 4 : adding unlimited length escapes #

Total comments: 2

Patch Set 5 : . #

Unified diffs Side-by-side diffs Delta from patch set Stats (+221 lines, -10 lines) Patch
M src/parser.h View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M src/parser.cc View 1 2 3 4 chunks +49 lines, -9 lines 0 comments Download
M src/scanner.h View 1 2 3 2 chunks +6 lines, -0 lines 0 comments Download
M src/scanner.cc View 1 2 3 4 5 chunks +40 lines, -1 line 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 1 chunk +42 lines, -0 lines 0 comments Download
A test/mjsunit/es6/unicode-escapes.js View 1 2 3 1 chunk +80 lines, -0 lines 0 comments Download

Messages

Total messages: 14 (4 generated)
marja
rossberg, ptal
6 years, 1 month ago (2014-11-07 15:45:11 UTC) #2
arv (Not doing code reviews)
Should we add a new flag for this? https://codereview.chromium.org/706263002/diff/20001/src/scanner.cc File src/scanner.cc (right): https://codereview.chromium.org/706263002/diff/20001/src/scanner.cc#newcode901 src/scanner.cc:901: uc32 ...
6 years, 1 month ago (2014-11-07 16:23:20 UTC) #4
caitp (gmail)
https://codereview.chromium.org/706263002/diff/20001/src/scanner.cc File src/scanner.cc (right): https://codereview.chromium.org/706263002/diff/20001/src/scanner.cc#newcode901 src/scanner.cc:901: uc32 c = ScanHexNumber(4); If `has_brace` is true, we ...
6 years, 1 month ago (2014-11-07 16:23:55 UTC) #6
mathias
https://codereview.chromium.org/706263002/diff/20001/test/mjsunit/es6/unicode-escapes.js File test/mjsunit/es6/unicode-escapes.js (right): https://codereview.chromium.org/706263002/diff/20001/test/mjsunit/es6/unicode-escapes.js#newcode34 test/mjsunit/es6/unicode-escapes.js:34: // flags. `u{…}` escapes are only allowed in regular ...
6 years, 1 month ago (2014-11-07 16:37:57 UTC) #8
caitp (gmail)
https://codereview.chromium.org/706263002/diff/20001/src/scanner.cc File src/scanner.cc (right): https://codereview.chromium.org/706263002/diff/20001/src/scanner.cc#newcode907 src/scanner.cc:907: return 1; shouldn't this return -1 so that the ...
6 years, 1 month ago (2014-11-07 16:50:39 UTC) #9
caitp (gmail)
https://codereview.chromium.org/706263002/diff/60001/src/scanner.cc File src/scanner.cc (right): https://codereview.chromium.org/706263002/diff/60001/src/scanner.cc#newcode908 src/scanner.cc:908: if (c0_ != 'u') return false; Will cause `var ...
6 years, 1 month ago (2014-11-13 03:21:43 UTC) #10
marja
https://codereview.chromium.org/706263002/diff/60001/src/scanner.cc File src/scanner.cc (right): https://codereview.chromium.org/706263002/diff/60001/src/scanner.cc#newcode908 src/scanner.cc:908: if (c0_ != 'u') return false; On 2014/11/13 03:21:42, ...
6 years, 1 month ago (2014-11-13 10:06:23 UTC) #11
marja
I'll split this CL up, since the regexp escape handling is more complicated (requires checking ...
6 years, 1 month ago (2014-11-13 10:07:57 UTC) #12
rossberg
On 2014/11/13 10:07:57, marja wrote: > I'll split this CL up, since the regexp escape ...
6 years, 1 month ago (2014-11-13 10:10:20 UTC) #13
marja
6 years, 1 month ago (2014-11-13 11:53:20 UTC) #14
I split the first part off of this CL, ptal here:
https://codereview.chromium.org/716423002/

(My intention was to do all the things you pointed out; except the ones related
to regexps.)

https://codereview.chromium.org/706263002/diff/20001/src/scanner.cc
File src/scanner.cc (right):

https://codereview.chromium.org/706263002/diff/20001/src/scanner.cc#newcode901
src/scanner.cc:901: uc32 c = ScanHexNumber(4);
On 2014/11/07 16:23:20, arv wrote:
> In case of u{ then there is no upper limit for the number of hex digits.

Done.

https://codereview.chromium.org/706263002/diff/20001/src/scanner.cc#newcode907
src/scanner.cc:907: return 1;
On 2014/11/07 16:50:39, caitp wrote:
> shouldn't this return -1 so that the scanner knows it's a bad token? otherwise
> it looks the same as \u{1}

Done.

https://codereview.chromium.org/706263002/diff/20001/test/cctest/test-parsing.cc
File test/cctest/test-parsing.cc (right):

https://codereview.chromium.org/706263002/diff/20001/test/cctest/test-parsing...
test/cctest/test-parsing.cc:4316: "\"foob\\u{c4}r\"",
On 2014/11/07 16:23:20, arv wrote:
> Can you add a test for 
> 
>
http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string-literals-stat...
> 
> UnicodeEscapeSequence :: u{ HexDigits }
> 
>   It is a Syntax Error if the MV of HexDigits > 1114111.

Done.

https://codereview.chromium.org/706263002/diff/20001/test/cctest/test-parsing...
test/cctest/test-parsing.cc:4344: "/[\\u{0062-\\u{0066 ]oo/",
On 2014/11/07 16:23:20, arv wrote:
> Can you add a test with more than 4 hex numbers?
> 
> The following should be legal
> 
> \U{000000000000000000000000000000000000000000000000062}

Done.

https://codereview.chromium.org/706263002/diff/20001/test/mjsunit/es6/unicode...
File test/mjsunit/es6/unicode-escapes.js (right):

https://codereview.chromium.org/706263002/diff/20001/test/mjsunit/es6/unicode...
test/mjsunit/es6/unicode-escapes.js:9: function TestVariableNames1() {
On 2014/11/07 16:23:20, arv wrote:
> Or
> 
> (function TestVariableNames1() {
>    ...
> })();
> 
> less likely to have typos in the name cause tests to not run.

Done.

https://codereview.chromium.org/706263002/diff/20001/test/mjsunit/es6/unicode...
test/mjsunit/es6/unicode-escapes.js:28: var s2 = "foob\u{0061}r";
On 2014/11/07 16:23:20, arv wrote:
> var s2 = "foob\u{61}r";

Done.

https://codereview.chromium.org/706263002/diff/20001/test/mjsunit/es6/unicode...
test/mjsunit/es6/unicode-escapes.js:34: // flags.
On 2014/11/07 16:37:57, mathias wrote:
> `u{…}` escapes are only allowed in regular expressions when the `u` flag is
set
> – they should throw otherwise.

Regexp escapes will be added in a separate CL.

Powered by Google App Engine
This is Rietveld 408576698