OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 | |
6 "use strict"; | |
7 | |
8 var Debug = debug.Debug; | |
9 var exception = null; | |
10 var super_called = false; | |
11 var step_count = 0; | |
12 | |
13 function listener(event, execState, eventData, data) { | |
14 if (event != Debug.DebugEvent.Break) return; | |
15 try { | |
16 execState.prepareStep(Debug.StepAction.StepIn); | |
17 var s = execState.frame().sourceLineText(); | |
18 step_count++; | |
19 assertTrue(s.indexOf('// ' + step_count + '.') >= 0); | |
20 } catch (e) { | |
21 exception = e; | |
22 } | |
23 } | |
24 | |
25 class Base { | |
26 constructor() { | |
27 var x = 1; // 2. | |
28 } // 3. | |
29 } | |
30 | |
31 class Derived extends Base {} // 1. // 4. | |
32 | |
33 Debug.setListener(listener); | |
34 var bp = Debug.setBreakPoint(Derived, 0); | |
35 | |
36 new Derived(); | |
37 | |
38 Debug.setListener(null); // 5. | |
39 | |
40 assertNull(exception); | |
41 assertEquals(5, step_count); | |
OLD | NEW |