| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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: --ignition-generators |
| 6 |
| 5 // Test generator states. | 7 // Test generator states. |
| 6 | 8 |
| 7 function Foo() {} | 9 function Foo() {} |
| 8 function Bar() {} | 10 function Bar() {} |
| 9 | 11 |
| 10 function assertIteratorResult(value, done, result) { | 12 function assertIteratorResult(value, done, result) { |
| 11 assertEquals({ value: value, done: done}, result); | 13 assertEquals({ value: value, done: done}, result); |
| 12 } | 14 } |
| 13 | 15 |
| 14 function assertIteratorIsClosed(iter) { | 16 function assertIteratorIsClosed(iter) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 87 } |
| 86 { | 88 { |
| 87 let x; | 89 let x; |
| 88 let g = function*() { | 90 let g = function*() { |
| 89 try {return 42} finally {try {x.throw(666)} catch(e) {}} | 91 try {return 42} finally {try {x.throw(666)} catch(e) {}} |
| 90 }; | 92 }; |
| 91 | 93 |
| 92 x = g(); | 94 x = g(); |
| 93 assertEquals({value: 42, done: true}, x.next()); | 95 assertEquals({value: 42, done: true}, x.next()); |
| 94 } | 96 } |
| OLD | NEW |