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

Issue 1070633002: [strong] Implement static restrictions on binding/assignment to 'undefined' identifier. (Closed)

Created:
5 years, 8 months ago by conradw
Modified:
5 years, 8 months ago
Reviewers:
rossberg
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Target Ref:
refs/pending/heads/master
Project:
v8
Visibility:
Public.

Description

[strong] Implement static restrictions on binding/assignment to 'undefined' identifier. Delete unused (and now incorrect) function IsValidStrictVariable. Implements the strong mode proposal's static restrictions on the use of the identifier 'undefined'. Assumes these restrictions are intended to be identical to the restrictions on the use of 'eval' and 'arguments' in strict mode. The AllowEvalOrArgumentsAsIdentifier enum has been renamed to AllowRestrictedIdentifiers as logic involving it is now also used for this case. BUG=v8:3956 LOG=N Committed: https://crrev.com/8ef7159582dde933c71a7c6d73b6e936cf42a5cb Cr-Commit-Position: refs/heads/master@{#27744}

Patch Set 1 #

Total comments: 14

Patch Set 2 : after cr #

Patch Set 3 : make sure correct exception is tested for #

Patch Set 4 : add assignment tests for for(-in, -of) constructs #

Patch Set 5 : minor test correction #

Total comments: 14

Patch Set 6 : improve tests (rebase, only undefined.js has changed) #

Total comments: 4

Patch Set 7 : add parser sync tests, improve js tests #

Patch Set 8 : rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -41 lines) Patch
M src/ast-value-factory.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M src/messages.js View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M src/parser.h View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M src/parser.cc View 1 2 3 4 5 6 7 14 chunks +31 lines, -11 lines 0 comments Download
M src/preparser.h View 1 2 3 4 5 6 7 15 chunks +52 lines, -22 lines 0 comments Download
M src/preparser.cc View 1 2 3 4 5 6 7 10 chunks +23 lines, -8 lines 0 comments Download
M test/cctest/test-parsing.cc View 1 2 3 4 5 6 7 1 chunk +31 lines, -0 lines 0 comments Download
A test/mjsunit/strong/undefined.js View 1 2 3 4 5 6 1 chunk +192 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (7 generated)
conradw
On 2015/04/08 09:35:20, conradw wrote: > mailto:conradw@chromium.org changed reviewers: > + mailto:rossberg@chromium.org PTAL
5 years, 8 months ago (2015-04-08 09:35:49 UTC) #3
rossberg
Mostly looking good, just needs more test coverage. https://codereview.chromium.org/1070633002/diff/20001/src/messages.js File src/messages.js (right): https://codereview.chromium.org/1070633002/diff/20001/src/messages.js#newcode169 src/messages.js:169: strong_undefined: ...
5 years, 8 months ago (2015-04-08 11:30:11 UTC) #4
conradw
https://codereview.chromium.org/1070633002/diff/20001/src/messages.js File src/messages.js (right): https://codereview.chromium.org/1070633002/diff/20001/src/messages.js#newcode169 src/messages.js:169: strong_undefined: ["In strong mode, binding or assigning to 'undefined' ...
5 years, 8 months ago (2015-04-09 12:22:22 UTC) #9
conradw
https://codereview.chromium.org/1070633002/diff/20001/src/preparser.h File src/preparser.h (right): https://codereview.chromium.org/1070633002/diff/20001/src/preparser.h#newcode149 src/preparser.h:149: enum AllowRestrictedIdentifiers { On 2015/04/08 11:30:11, rossberg wrote: > ...
5 years, 8 months ago (2015-04-09 12:24:17 UTC) #10
rossberg
https://codereview.chromium.org/1070633002/diff/100001/test/mjsunit/strong/undefined.js File test/mjsunit/strong/undefined.js (right): https://codereview.chromium.org/1070633002/diff/100001/test/mjsunit/strong/undefined.js#newcode5 test/mjsunit/strong/undefined.js:5: // Flags: --strong-mode --harmony-classes --harmony-sloppy --harmony-arrow-functions You shouldn't need ...
5 years, 8 months ago (2015-04-09 13:40:18 UTC) #11
conradw
https://codereview.chromium.org/1070633002/diff/100001/test/mjsunit/strong/undefined.js File test/mjsunit/strong/undefined.js (right): https://codereview.chromium.org/1070633002/diff/100001/test/mjsunit/strong/undefined.js#newcode5 test/mjsunit/strong/undefined.js:5: // Flags: --strong-mode --harmony-classes --harmony-sloppy --harmony-arrow-functions On 2015/04/09 13:40:17, ...
5 years, 8 months ago (2015-04-09 16:53:09 UTC) #12
rossberg
LGTM, modulo minor tweaks https://codereview.chromium.org/1070633002/diff/120001/test/mjsunit/strong/undefined.js File test/mjsunit/strong/undefined.js (right): https://codereview.chromium.org/1070633002/diff/120001/test/mjsunit/strong/undefined.js#newcode12 test/mjsunit/strong/undefined.js:12: assertThrows("'use strict'; " + code ...
5 years, 8 months ago (2015-04-10 07:31:29 UTC) #13
conradw
Also added parser sync tests - PTAL https://codereview.chromium.org/1070633002/diff/120001/test/mjsunit/strong/undefined.js File test/mjsunit/strong/undefined.js (right): https://codereview.chromium.org/1070633002/diff/120001/test/mjsunit/strong/undefined.js#newcode12 test/mjsunit/strong/undefined.js:12: assertThrows("'use strict'; ...
5 years, 8 months ago (2015-04-10 11:02:06 UTC) #14
rossberg
lgtm
5 years, 8 months ago (2015-04-10 11:33:57 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1070633002/160001
5 years, 8 months ago (2015-04-10 11:42:20 UTC) #17
commit-bot: I haz the power
Committed patchset #8 (id:160001)
5 years, 8 months ago (2015-04-10 12:04:57 UTC) #18
commit-bot: I haz the power
5 years, 8 months ago (2015-04-10 12:05:12 UTC) #19
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/8ef7159582dde933c71a7c6d73b6e936cf42a5cb
Cr-Commit-Position: refs/heads/master@{#27744}

Powered by Google App Engine
This is Rietveld 408576698