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

Side by Side Diff: test/mjsunit/regress/regress-5636-1.js

Issue 2673403003: [parsing] Fix maybe-assigned for loop variables. (Closed)
Patch Set: Address feedback. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/regress/regress-5636-2.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --allow-natives-syntax --function-context-specialization
6
7 function f(n) {
8 var a = [];
9 function g() { return x }
10 for (var i = 0; i < n; ++i) {
11 var x = i;
12 a[i] = g;
13 %OptimizeFunctionOnNextCall(g);
14 g();
15 }
16 return a;
17 }
18 var a = f(3);
19 assertEquals(3, a.length);
20 assertEquals(2, a[0]());
21 assertEquals(2, a[1]());
22 assertEquals(2, a[2]());
OLDNEW
« no previous file with comments | « test/cctest/test-parsing.cc ('k') | test/mjsunit/regress/regress-5636-2.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698