Debian Codegraph @

js/src/jit-test/tests/debug/execution-observability-05.js

raw
1 // Test that we can do debug mode OSR from the interrupt handler through an
2 // on->off->on cycle.
3
4 var global = this;
5 var hits = 0;
6 setInterruptCallback(function() {
7 print("Interrupt!");
8 hits++;
9 var g = newGlobal({newCompartment: true});
10 g.parent = global;
11 g.eval("var dbg = new Debugger(parent); dbg.onEnterFrame = function(frame) {};");
12 g.eval("dbg.removeDebuggee(parent);");
13 return true;
14 });
15
16 function f(x) {
17 if (x > 200)
18 return;
19 interruptIf(x == 100);
20 f(x + 1);
21 }
22 f(0);
23 assertEq(hits, 1);