| OLD | NEW |
| (Empty) |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 // Flags: --harmony-async-await | |
| 6 | |
| 7 Debug = debug.Debug | |
| 8 | |
| 9 listenerComplete = false; | |
| 10 breakPointCount = 0; | |
| 11 | |
| 12 async function f() { | |
| 13 await (async function() { var a = "a"; await 1; debugger; })(); | |
| 14 | |
| 15 var b = "b"; | |
| 16 | |
| 17 assertTrue(listenerDone); | |
| 18 assertFalse(exception); | |
| 19 assertEquals(1, breakpointCount); | |
| 20 } | |
| 21 | |
| 22 function listener(event, exec_state, event_data, data) { | |
| 23 try { | |
| 24 if (event != Debug.DebugEvent.Break) return; | |
| 25 | |
| 26 breakpointCount++; | |
| 27 listenerDone = true; | |
| 28 assertEquals("a", exec_state.frame(0).evaluate("a")); | |
| 29 assertEquals("b", exec_state.frame(1).evaluate("b")); | |
| 30 assertEquals("c", exec_state.frame(2).evaluate("c")); | |
| 31 } catch (e) { | |
| 32 exception = e; | |
| 33 }; | |
| 34 }; | |
| 35 | |
| 36 Debug.setListener(listener); | |
| 37 | |
| 38 var c = "c"; | |
| 39 f(); | |
| OLD | NEW |