OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 | |
6 | 5 |
7 function static() { | 6 function static() { |
8 print("> static"); // Break | 7 print("> static"); // Break |
9 } | 8 } |
10 | 9 |
11 var Debug = debug.Debug; | 10 var Debug = debug.Debug; |
12 var exception = null; | 11 var exception = null; |
13 var break_count = 0; | 12 var break_count = 0; |
14 | 13 |
15 function listener(event, exec_state, event_data, data) { | 14 function listener(event, exec_state, event_data, data) { |
(...skipping 20 matching lines...) Expand all Loading... |
36 | 35 |
37 var scripts = Debug.scripts(); | 36 var scripts = Debug.scripts(); |
38 var dynamic_script; | 37 var dynamic_script; |
39 var static_script; | 38 var static_script; |
40 for (var script of scripts) { | 39 for (var script of scripts) { |
41 if (script.source_url == "dynamicScript") dynamic_script = script; | 40 if (script.source_url == "dynamicScript") dynamic_script = script; |
42 if (script.source_url == "staticScript") static_script = script; | 41 if (script.source_url == "staticScript") static_script = script; |
43 } | 42 } |
44 | 43 |
45 Debug.setScriptBreakPointById(dynamic_script.id, 1); | 44 Debug.setScriptBreakPointById(dynamic_script.id, 1); |
46 Debug.setScriptBreakPointById(static_script.id, 7); | 45 Debug.setScriptBreakPointById(static_script.id, 6); |
47 | 46 |
48 dynamic(); | 47 dynamic(); |
49 static(); | 48 static(); |
50 | 49 |
51 Debug.setListener(null); | 50 Debug.setListener(null); |
52 | 51 |
53 assertNull(exception); | 52 assertNull(exception); |
54 assertEquals(2, break_count); | 53 assertEquals(2, break_count); |
55 | 54 |
56 //@ sourceURL=staticScript | 55 //@ sourceURL=staticScript |
OLD | NEW |