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: --cache=code |
| 6 |
5 Debug = debug.Debug | 7 Debug = debug.Debug |
6 | 8 |
7 // Simple debug event handler which first time hit will perform 1000 steps and | 9 // Simple debug event handler which first time hit will perform 1000 steps and |
8 // second time hit will evaluate and store the value of "i". If requires that | 10 // second time hit will evaluate and store the value of "i". If requires that |
9 // the global property "state" is initially zero. | 11 // the global property "state" is initially zero. |
10 | 12 |
11 var bp1, bp2; | 13 var bp1, bp2; |
12 | 14 |
13 function listener(event, exec_state, event_data, data) { | 15 function listener(event, exec_state, event_data, data) { |
14 if (event == Debug.DebugEvent.Break) { | 16 if (event == Debug.DebugEvent.Break) { |
(...skipping 23 matching lines...) Expand all Loading... |
38 | 40 |
39 // Set a breakpoint on the for statement (line 1). | 41 // Set a breakpoint on the for statement (line 1). |
40 bp1 = Debug.setBreakPoint(f, 1); | 42 bp1 = Debug.setBreakPoint(f, 1); |
41 | 43 |
42 // Check that performing 1000 steps will make i 333. | 44 // Check that performing 1000 steps will make i 333. |
43 var step_count = 1000; | 45 var step_count = 1000; |
44 result = -1; | 46 result = -1; |
45 f(); | 47 f(); |
46 assertEquals(333, result); | 48 assertEquals(333, result); |
47 Debug.setListener(null); | 49 Debug.setListener(null); |
OLD | NEW |