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

Issue 11031045: Reject uses of lexical for-loop variable on the RHS. (Closed)

Created:
8 years, 2 months ago by rossberg
Modified:
8 years, 2 months ago
Reviewers:
Michael Starzinger
CC:
v8-dev
Visibility:
Public.

Description

Reject uses of lexical for-loop variable on the RHS. R=mstarzinger@chromium.org BUG=v8:2322 Committed: https://code.google.com/p/v8/source/detail?r=12664

Patch Set 1 #

Total comments: 6
Unified diffs Side-by-side diffs Delta from patch set Stats (+9 lines, -6 lines) Patch
M src/parser.cc View 1 chunk +5 lines, -2 lines 4 comments Download
A + test/mjsunit/regress/regress-2322.js View 1 chunk +4 lines, -4 lines 2 comments Download

Messages

Total messages: 3 (0 generated)
rossberg
8 years, 2 months ago (2012-10-04 16:20:43 UTC) #1
Michael Starzinger
LGTM (with nits). https://codereview.chromium.org/11031045/diff/1/src/parser.cc File src/parser.cc (right): https://codereview.chromium.org/11031045/diff/1/src/parser.cc#newcode2794 src/parser.cc:2794: top_scope_->NewUnresolved(factory(), name, interface); For consistency we ...
8 years, 2 months ago (2012-10-05 08:42:36 UTC) #2
rossberg
8 years, 2 months ago (2012-10-05 09:15:02 UTC) #3
https://codereview.chromium.org/11031045/diff/1/src/parser.cc
File src/parser.cc (right):

https://codereview.chromium.org/11031045/diff/1/src/parser.cc#newcode2794
src/parser.cc:2794: top_scope_->NewUnresolved(factory(), name, interface);
On 2012/10/05 08:42:36, Michael Starzinger wrote:
> For consistency we could also move this loop variable and interface down.

Done.

https://codereview.chromium.org/11031045/diff/1/src/parser.cc#newcode2841
src/parser.cc:2841: Interface* interface = Interface::NewValue();
On 2012/10/05 08:42:36, Michael Starzinger wrote:
> Can we also move the interface down right before the loop variable is created?

Inlined instead.

https://codereview.chromium.org/11031045/diff/1/test/mjsunit/regress/regress-...
File test/mjsunit/regress/regress-2322.js (right):

https://codereview.chromium.org/11031045/diff/1/test/mjsunit/regress/regress-...
test/mjsunit/regress/regress-2322.js:30: assertThrows("for (let x in x);",
SyntaxError);
On 2012/10/05 08:42:36, Michael Starzinger wrote:
> You probably want to add 'use strict' to this test case, to make sure that the
> original problem repros.

Indeed.

Powered by Google App Engine
This is Rietveld 408576698