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

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

Issue 1738463003: Ship ES2015 iterator finalization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix cctest.status Created 4 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
« test/cctest/cctest.status ('K') | « test/cctest/cctest.status ('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
1 // Copyright 2015 the V8 project authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Flags: --harmony-do-expressions 5 // Flags: --harmony-do-expressions --noharmony-iterator-close
6 6
7 (function testWithSimpleLoopVariable() { 7 (function testWithSimpleLoopVariable() {
8 var f = (x, y = (do { var s=0; for (var e of x) s += e; s; })) => y*(y+1); 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. 9 var result = f([1,2,3]); // core dump here, if not fixed.
10 assertEquals(result, 42); 10 assertEquals(result, 42);
11 })(); 11 })();
12 12
13 (function testWithComplexLoopVariable() { 13 (function testWithComplexLoopVariable() {
14 var f = (x, i=x[0]-1, a=[], 14 var f = (x, i=x[0]-1, a=[],
15 y = (do { var s=0; 15 y = (do { var s=0;
16 for (a[i] of x) s += a[i++]; 16 for (a[i] of x) s += a[i++];
17 s; 17 s;
18 })) => y*(a[0]+a[1]*a[2]); 18 })) => y*(a[0]+a[1]*a[2]);
19 var result = f([1,2,3]); // core dump here, if not fixed. 19 var result = f([1,2,3]); // core dump here, if not fixed.
20 assertEquals(result, 42); 20 assertEquals(result, 42);
21 })(); 21 })();
OLDNEW
« test/cctest/cctest.status ('K') | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698