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