MCPcopy Index your code
hub / github.com/nodejs/node / TestCase

Function TestCase

deps/v8/test/debugger/debug/debug-step-4.js:32–74  ·  view source on GitHub ↗
(expected_final_state)

Source from the content-addressed store, hash-verified

30}
31
32function TestCase(expected_final_state) {
33 var listener_exception = null;
34 var state_snapshot;
35 var listener_state;
36 var bp;
37
38 function listener(event, exec_state, event_data, data) {
39 const location = exec_state.frames[0].location
40 print("Here (" + event + "/" + listener_state + "): " +
41 location.lineNumber + ":" + location.columnNumber);
42 try {
43 if (event == Debug.DebugEvent.Break) {
44 if (listener_state == 0) {
45 Debug.clearBreakPoint(bp);
46 Debug.stepOver();
47 listener_state = 1;
48 } else if (listener_state == 1) {
49 state_snapshot = String(state);
50 print("State: " + state_snapshot);
51 Debug.setListener(null);
52 listener_state = 2;
53 }
54 }
55 } catch (e) {
56 listener_exception = e;
57 }
58 }
59
60
61 // Add the debug event listener.
62 listener_state = 0;
63 Debug.setListener(listener);
64 bp = Debug.setBreakPoint(f, 1);
65
66 h();
67 Debug.setListener(null);
68 if (listener_exception !== null) {
69 print("Exception caught: " + listener_exception);
70 assertUnreachable();
71 }
72
73 assertEquals(expected_final_state, state_snapshot);
74}
75
76
77// Warm-up -- make sure all is compiled and ready for breakpoint.

Callers 1

debug-step-4.jsFile · 0.70

Calls 6

assertUnreachableFunction · 0.85
setListenerMethod · 0.80
setBreakPointMethod · 0.80
hFunction · 0.70
printFunction · 0.50
assertEqualsFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…