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: --expose-debug-as debug | 5 // Flags: --expose-debug-as debug |
6 | 6 |
7 | 7 |
8 Debug = debug.Debug | 8 Debug = debug.Debug |
9 | 9 |
10 let error = false; | 10 let error = false; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 | 60 |
61 assertCaught(() => { | 61 assertCaught(() => { |
62 try { | 62 try { |
63 for (var a of [1, 2, 3]) { | 63 for (var a of [1, 2, 3]) { |
64 try {throw a} finally {} | 64 try {throw a} finally {} |
65 } | 65 } |
66 } catch(_) {} | 66 } catch(_) {} |
67 }); | 67 }); |
68 | 68 |
69 | 69 |
| 70 // Check that an internal exception in our yield* desugaring is not observable. |
| 71 { |
| 72 uncaught = null; |
| 73 |
| 74 let iter = { |
| 75 next() {return {value:42, done:false}}, |
| 76 throw() {return {done:true}} |
| 77 }; |
| 78 let iterable = {[Symbol.iterator]() {return iter}}; |
| 79 function* f() { yield* iterable } |
| 80 |
| 81 let g = f(); |
| 82 g.next(); |
| 83 assertEquals({value: undefined, done: true}, g.throw()); |
| 84 assertNull(uncaught); // No exception event was generated. |
| 85 } |
| 86 |
| 87 |
70 assertFalse(error); | 88 assertFalse(error); |
OLD | NEW |