summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/execution-observability-06.js
blob: 87919ade2056f0ed5a79e329748f2bd80c02192d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Test that OSR respect debuggeeness.

var g = newGlobal();
var dbg = new Debugger(g);

g.eval("" + function f(c) {
  if (c == 0)
    return;
  if (c == 2)
    debugger;
  f(c-1);
  acc = 0;
  for (var i = 0; i < 100; i++)
    acc += i;
});

var log = "";
dbg.onDebuggerStatement = function (frame) {
  frame.onPop = function f() { log += "p"; }
};

g.eval("f(2)");

assertEq(log, "p");