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 --allow-natives-syntax --harmony-async-await | 5 // Flags: --expose-debug-as debug --allow-natives-syntax --harmony-async-await |
6 // Flags: --no-ignition-generators | |
7 | 6 |
8 var Debug = debug.Debug; | 7 var Debug = debug.Debug; |
9 var step_count = 0; | 8 var step_count = 0; |
10 | 9 |
11 function listener(event, execState, eventData, data) { | 10 function listener(event, execState, eventData, data) { |
12 if (event != Debug.DebugEvent.Break) return; | 11 if (event != Debug.DebugEvent.Break) return; |
13 try { | 12 try { |
14 var line = execState.frame(0).sourceLineText(); | 13 var line = execState.frame(0).sourceLineText(); |
15 print(line); | 14 print(line); |
16 var [match, expected_count, step] = /\/\/ B(\d) (\w+)$/.exec(line); | 15 var [match, expected_count, step] = /\/\/ B(\d) (\w+)$/.exec(line); |
17 assertEquals(parseInt(expected_count), step_count++); | 16 assertEquals(step_count++, parseInt(expected_count)); |
18 if (step != "Continue") execState.prepareStep(Debug.StepAction[step]); | 17 if (step != "Continue") execState.prepareStep(Debug.StepAction[step]); |
19 } catch (e) { | 18 } catch (e) { |
20 print(e, e.stack); | 19 print(e, e.stack); |
21 quit(1); | 20 quit(1); |
22 } | 21 } |
23 } | 22 } |
24 | 23 |
25 Debug.setListener(listener); | 24 Debug.setListener(listener); |
26 | 25 |
27 var late_resolve; | 26 var late_resolve; |
(...skipping 19 matching lines...) Expand all Loading... |
47 | 46 |
48 // Continuing at an intermediate break point means that we will | 47 // Continuing at an intermediate break point means that we will |
49 // carry on with the current async step. | 48 // carry on with the current async step. |
50 debugger; // B5 Continue | 49 debugger; // B5 Continue |
51 | 50 |
52 late_resolve(3); | 51 late_resolve(3); |
53 | 52 |
54 %RunMicrotasks(); | 53 %RunMicrotasks(); |
55 | 54 |
56 assertEquals(8, step_count); | 55 assertEquals(8, step_count); |
OLD | NEW |