summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/execution-observability-06.js
blob: fbc39130024d431efc4db9102675d341c7677227 (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({newCompartment: true});
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");