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

Side by Side Diff: test/mjsunit/regress/regress-5636-2.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/mjsunit/regress/regress-5636-1.js ('k') | no next file » | 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
6
7 function f(n) {
8 "use asm";
9 var a = [];
10 function g() { return x }
11 for (var i = 0; i < n; ++i) {
12 var x = i;
13 a[i] = g;
14 %OptimizeFunctionOnNextCall(g);
15 g();
16 }
17 return a;
18 }
19 var a = f(3);
20 assertEquals(3, a.length);
21 assertEquals(2, a[0]());
22 assertEquals(2, a[1]());
23 assertEquals(2, a[2]());
OLDNEW
« no previous file with comments | « test/mjsunit/regress/regress-5636-1.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698