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: --allow-natives-syntax | |
6 | 5 |
7 // Test that setting break point works correctly when the debugger is | 6 // Test that setting break point works correctly when the debugger is |
8 // activated late, which leads to duplicate shared function infos. | 7 // activated late, which leads to duplicate shared function infos. |
9 | 8 |
10 (function() { | 9 (function() { |
11 var Debug = %GetDebugContext().Debug; | 10 var Debug = %GetDebugContext().Debug; |
12 | 11 |
13 function listener(event, exec_state, event_data, data) { | 12 function listener(event, exec_state, event_data, data) { |
14 if (event != Debug.DebugEvent.Break) return; | 13 if (event != Debug.DebugEvent.Break) return; |
15 try { | 14 try { |
(...skipping 11 matching lines...) Expand all Loading... |
27 Debug.setListener(listener); | 26 Debug.setListener(listener); |
28 if (i < 2) Debug.setBreakPoint(foo, 0, 0); | 27 if (i < 2) Debug.setBreakPoint(foo, 0, 0); |
29 assertTrue(/\[B\d\]a = 1/.test(Debug.showBreakPoints(foo))); | 28 assertTrue(/\[B\d\]a = 1/.test(Debug.showBreakPoints(foo))); |
30 foo(); | 29 foo(); |
31 assertEquals(1, break_count); | 30 assertEquals(1, break_count); |
32 assertNull(exception); | 31 assertNull(exception); |
33 } | 32 } |
34 | 33 |
35 Debug.setListener(null); | 34 Debug.setListener(null); |
36 })(); | 35 })(); |
OLD | NEW |