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: --expose-debug-as debug | 5 // Flags: --expose-debug-as debug |
6 | 6 |
7 'use strict'; | 7 'use strict'; |
8 | 8 |
9 var Debug = debug.Debug | 9 var Debug = debug.Debug |
10 var done, stepCount; | 10 var done, stepCount; |
11 | 11 |
12 function listener(event, execState, eventData, data) { | 12 function listener(event, execState, eventData, data) { |
13 if (event == Debug.DebugEvent.Break) { | 13 if (event == Debug.DebugEvent.Break) { |
14 if (!done) { | 14 if (!done) { |
15 execState.prepareStep(Debug.StepAction.StepInto); | 15 execState.prepareStep(Debug.StepAction.StepIn); |
16 var s = execState.frame().sourceLineText(); | 16 var s = execState.frame().sourceLineText(); |
17 assertTrue(s.indexOf('// ' + stepCount + '.') !== -1); | 17 assertTrue(s.indexOf('// ' + stepCount + '.') !== -1); |
18 stepCount++; | 18 stepCount++; |
19 } | 19 } |
20 } | 20 } |
21 }; | 21 }; |
22 | 22 |
23 Debug.setListener(listener); | 23 Debug.setListener(listener); |
24 | 24 |
25 | 25 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 var bp = Debug.setBreakPoint(f, 0); | 105 var bp = Debug.setBreakPoint(f, 0); |
106 f(); | 106 f(); |
107 assertEquals(1, stepCount); | 107 assertEquals(1, stepCount); |
108 | 108 |
109 Debug.clearBreakPoint(bp); | 109 Debug.clearBreakPoint(bp); |
110 })(); | 110 })(); |
111 | 111 |
112 | 112 |
113 Debug.setListener(null); | 113 Debug.setListener(null); |
OLD | NEW |