OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --ignition |
| 6 |
| 7 // Test that asynchronous features do not work with |
| 8 // side-effect free debug-evaluate. |
| 9 |
| 10 Debug = debug.Debug |
| 11 |
| 12 var exception = null; |
| 13 |
| 14 function* generator() { |
| 15 yield 1; |
| 16 } |
| 17 |
| 18 async function async() { |
| 19 return 1; |
| 20 } |
| 21 |
| 22 var g = generator(); |
| 23 |
| 24 function listener(event, exec_state, event_data, data) { |
| 25 if (event != Debug.DebugEvent.Break) return; |
| 26 try { |
| 27 function fail(source) { |
| 28 assertThrows(() => exec_state.frame(0).evaluate(source, true), |
| 29 EvalError); |
| 30 } |
| 31 fail("new Promise()"); |
| 32 fail("generator()"); |
| 33 fail("g.next()"); |
| 34 fail("async()"); |
| 35 } catch (e) { |
| 36 exception = e; |
| 37 print(e, e.stack); |
| 38 }; |
| 39 }; |
| 40 |
| 41 // Add the debug event listener. |
| 42 Debug.setListener(listener); |
| 43 |
| 44 function f() { |
| 45 debugger; |
| 46 }; |
| 47 |
| 48 f(); |
| 49 |
| 50 assertNull(exception); |
OLD | NEW |