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

Side by Side Diff: test/mjsunit/harmony/generators.js

Issue 1695393003: [es6] Implement for-of iterator finalization (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable iterator test for Ignition 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
« no previous file with comments | « test/mjsunit/harmony/destructuring.js ('k') | test/mjsunit/harmony/iterator-close.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 the V8 project authors. All rights reserved. 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 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 5
6 { // yield in try-catch 6 { // yield in try-catch
7 7
8 let g = function*() { 8 let g = function*() {
9 try {yield 1} catch (error) {assertEquals("caught", error)} 9 try {yield 1} catch (error) {assertEquals("caught", error)}
10 }; 10 };
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 assertEquals({value: 43, done: false}, x.next(666)); 231 assertEquals({value: 43, done: false}, x.next(666));
232 assertEquals({value: undefined, done: false}, x.next()); 232 assertEquals({value: undefined, done: false}, x.next());
233 assertEquals({value: undefined, done: true}, x.next()); 233 assertEquals({value: undefined, done: true}, x.next());
234 } 234 }
235 235
236 { 236 {
237 let x = g(); 237 let x = g();
238 assertEquals({value: 1, done: false}, x.next()); 238 assertEquals({value: 1, done: false}, x.next());
239 assertEquals({value: 42, done: false}, x.next()); 239 assertEquals({value: 42, done: false}, x.next());
240 assertEquals({value: 43, done: false}, x.return(666)); 240 assertEquals({value: 43, done: false}, x.return(666));
241 assertEquals({value: 666, done: false}, x.next()); 241 assertEquals({value: undefined, done: false}, x.next());
242 assertEquals({value: undefined, done: true}, x.next()); 242 assertEquals({value: undefined, done: true}, x.next());
243 } 243 }
244 244
245 { 245 {
246 let x = g(); 246 let x = g();
247 assertEquals({value: 1, done: false}, x.next()); 247 assertEquals({value: 1, done: false}, x.next());
248 assertEquals({value: 42, done: false}, x.next()); 248 assertEquals({value: 42, done: false}, x.next());
249 assertEquals({value: 43, done: false}, x.throw(666)); 249 assertEquals({value: 43, done: false}, x.throw(666));
250 assertThrowsEquals(() => x.next(), 666); 250 assertThrowsEquals(() => x.next(), 666);
251 } 251 }
252 } 252 }
OLDNEW
« no previous file with comments | « test/mjsunit/harmony/destructuring.js ('k') | test/mjsunit/harmony/iterator-close.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698