summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/bug1756592.js
blob: bd10a269309355071e0152e9ea6a7880c5dfd343 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
let g = newGlobal({ newCompartment: true});
let d = new Debugger;
g.eval("function foo() { invokeInterruptCallback(() => {}) }");

// Warp-compile.
setInterruptCallback(function() { return true; });
for (var i = 0; i < 20; i++) {
  g.foo();
}

setInterruptCallback(function() {
  d.addDebuggee(g)
  d.getNewestFrame().onStep = function() {
    d.removeDebuggee(g);
    return { return: 42 };
  }
  return true
});

assertEq(g.foo(), 42);