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

Side by Side Diff: test/mjsunit/harmony/regress/regress-4658.js

Issue 1564343002: Fix for temporaries in parameter initializers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « src/parsing/parameter-initializer-rewriter.cc ('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 2015 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: --harmony-do-expressions
6
7 (function testWithSimpleLoopVariable() {
8 var f = (x, y = (do { var s=0; for (var e of x) s += e; s; })) => y*(y+1);
9 var result = f([1,2,3]); // core dump here, if not fixed.
10 assertEquals(result, 42);
11 })();
12
13 (function testWithComplexLoopVariable() {
14 var f = (x, i=x[0]-1, a=[],
15 y = (do { var s=0;
16 for (a[i] of x) s += a[i++];
17 s;
18 })) => y*(a[0]+a[1]*a[2]);
19 var result = f([1,2,3]); // core dump here, if not fixed.
20 assertEquals(result, 42);
21 })();
OLDNEW
« no previous file with comments | « src/parsing/parameter-initializer-rewriter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698