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

Issue 749633002: harmony-scoping: make assignment to 'const' a late error. (Closed)

Created:
6 years, 1 month ago by Dmitry Lomov (no reviews)
Modified:
6 years ago
CC:
v8-dev
Base URL:
https://chromium.googlesource.com/v8/v8.git@master
Project:
v8
Visibility:
Public.

Description

harmony-scoping: make assignment to 'const' a late error. Per TC39 Nov 2014 decision. This patch also changes behavior for "legacy const": assignments to sloppy const in strict mode is now also a type error. This fixes v8:2243 and also brings us in compliance with other engines re assignment to function names (see updated webkit test), but might have bigger implications. That change can easily be reverted by changing Variable::IsSignallingAssignmentToConst. BUG=v8:3713, v8:2243 LOG=N

Patch Set 1 #

Patch Set 2 : Completed #

Patch Set 3 : Ready for review #

Patch Set 4 : Self-review #

Patch Set 5 : Fix #

Total comments: 13

Patch Set 6 : CR feedback #

Patch Set 7 : feedback #

Patch Set 8 : one more #

Total comments: 6

Patch Set 9 : Patch for landing #

Patch Set 10 : Comment update #

Unified diffs Side-by-side diffs Delta from patch set Stats (+96 lines, -54 lines) Patch
M src/arm/full-codegen-arm.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M src/arm64/full-codegen-arm64.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M src/compiler/ast-graph-builder.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M src/compiler/ast-graph-builder.cc View 1 2 3 4 5 6 7 8 9 5 chunks +26 lines, -6 lines 0 comments Download
M src/full-codegen.h View 1 2 3 4 5 6 7 8 1 chunk +13 lines, -0 lines 0 comments Download
M src/hydrogen.cc View 1 2 3 chunks +7 lines, -3 lines 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -2 lines 0 comments Download
M src/runtime/runtime.h View 1 chunk +1 line, -0 lines 0 comments Download
M src/runtime/runtime-scopes.cc View 1 1 chunk +8 lines, -0 lines 0 comments Download
M src/scopes.cc View 1 2 3 1 chunk +0 lines, -15 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 4 5 6 7 8 1 chunk +2 lines, -1 line 0 comments Download
M test/mjsunit/harmony/block-const-assign.js View 1 3 chunks +18 lines, -11 lines 0 comments Download
M test/mjsunit/harmony/classes.js View 1 1 chunk +8 lines, -8 lines 0 comments Download
M test/mjsunit/harmony/module-linking.js View 1 2 chunks +2 lines, -2 lines 0 comments Download
M test/mjsunit/harmony/regress/regress-2243.js View 1 1 chunk +2 lines, -2 lines 0 comments Download
M test/mjsunit/regress/regress-2506.js View 1 2 1 chunk +1 line, -1 line 0 comments Download
M test/webkit/fast/js/basic-strict-mode-expected.txt View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 19 (3 generated)
Dmitry Lomov (no reviews)
PTAL
6 years ago (2014-11-21 19:37:34 UTC) #2
adamk
lgtm
6 years ago (2014-11-24 18:59:39 UTC) #3
rossberg
mstarzinger should judge the change to the graph builder. https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc#newcode2016 src/compiler/ast-graph-builder.cc:2016: ...
6 years ago (2014-11-25 15:23:36 UTC) #5
Michael Starzinger
https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc#newcode2016 src/compiler/ast-graph-builder.cc:2016: if (variable->IsSignallingAssignmentToConst(op, strict_mode())) { On 2014/11/25 15:23:36, rossberg wrote: ...
6 years ago (2014-11-25 15:48:35 UTC) #6
Dmitry Lomov (no reviews)
PTAL (comments addressed; sorry for rebase) https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc#newcode2016 src/compiler/ast-graph-builder.cc:2016: if (variable->IsSignallingAssignmentToConst(op, strict_mode())) ...
6 years ago (2014-11-25 15:51:02 UTC) #7
rossberg
https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc#newcode2016 src/compiler/ast-graph-builder.cc:2016: if (variable->IsSignallingAssignmentToConst(op, strict_mode())) { On 2014/11/25 15:51:01, Dmitry Lomov ...
6 years ago (2014-11-25 16:25:02 UTC) #8
Dmitry Lomov (no reviews)
https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc#newcode2016 src/compiler/ast-graph-builder.cc:2016: if (variable->IsSignallingAssignmentToConst(op, strict_mode())) { On 2014/11/25 16:25:02, rossberg wrote: ...
6 years ago (2014-11-25 17:22:31 UTC) #9
rossberg
https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc#newcode2016 src/compiler/ast-graph-builder.cc:2016: if (variable->IsSignallingAssignmentToConst(op, strict_mode())) { On 2014/11/25 17:22:31, Dmitry Lomov ...
6 years ago (2014-11-25 18:02:47 UTC) #10
Dmitry Lomov (no reviews)
https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/80001/src/compiler/ast-graph-builder.cc#newcode2016 src/compiler/ast-graph-builder.cc:2016: if (variable->IsSignallingAssignmentToConst(op, strict_mode())) { On 2014/11/25 18:02:47, rossberg wrote: ...
6 years ago (2014-11-25 18:37:26 UTC) #11
rossberg
Thanks. :) LGTM up to the comments below. https://codereview.chromium.org/749633002/diff/140001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/140001/src/compiler/ast-graph-builder.cc#newcode2041 src/compiler/ast-graph-builder.cc:2041: } ...
6 years ago (2014-11-26 08:31:46 UTC) #12
Dmitry Lomov (no reviews)
https://codereview.chromium.org/749633002/diff/140001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/140001/src/compiler/ast-graph-builder.cc#newcode2041 src/compiler/ast-graph-builder.cc:2041: } else if (mode == CONST && op != ...
6 years ago (2014-11-26 08:52:33 UTC) #13
rossberg
On 2014/11/26 08:52:33, Dmitry Lomov (chromium) wrote: > https://codereview.chromium.org/749633002/diff/140001/src/compiler/ast-graph-builder.cc > File src/compiler/ast-graph-builder.cc (right): > > ...
6 years ago (2014-11-26 09:28:35 UTC) #14
Dmitry Lomov (no reviews)
Comments addressed, landing https://codereview.chromium.org/749633002/diff/140001/src/compiler/ast-graph-builder.cc File src/compiler/ast-graph-builder.cc (right): https://codereview.chromium.org/749633002/diff/140001/src/compiler/ast-graph-builder.cc#newcode2041 src/compiler/ast-graph-builder.cc:2041: } else if (mode == CONST ...
6 years ago (2014-11-26 10:30:57 UTC) #15
Dmitry Lomov (no reviews)
Comments addressed, landing
6 years ago (2014-11-26 10:30:58 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/749633002/180001
6 years ago (2014-11-26 10:32:02 UTC) #18
commit-bot: I haz the power
6 years ago (2014-11-26 11:21:16 UTC) #19
Message was sent while issue was closed.
Committed patchset #10 (id:180001)

Powered by Google App Engine
This is Rietveld 408576698