OLD | NEW |
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 // Flags: --harmony-iterator-close | |
6 | |
7 | 5 |
8 function* g() { yield 42; return 88 }; | 6 function* g() { yield 42; return 88 }; |
9 | 7 |
10 | 8 |
11 // Return method is "undefined". | 9 // Return method is "undefined". |
12 { | 10 { |
13 g.prototype.return = null; | 11 g.prototype.return = null; |
14 | 12 |
15 | 13 |
16 assertEquals(undefined, (() => { | 14 assertEquals(undefined, (() => { |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1363 })()); | 1361 })()); |
1364 | 1362 |
1365 assertEquals(42, (() => { | 1363 assertEquals(42, (() => { |
1366 for (let x of g()) return 42; | 1364 for (let x of g()) return 42; |
1367 })()); | 1365 })()); |
1368 | 1366 |
1369 assertThrowsEquals(() => { | 1367 assertThrowsEquals(() => { |
1370 for (let x of g()) throw 42; | 1368 for (let x of g()) throw 42; |
1371 }, 42); | 1369 }, 42); |
1372 } | 1370 } |
OLD | NEW |