summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onPop-10.js
blob: 091bf076e4191b5b91348863460b510015e6465b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Setting onPop handlers from an onStep handler works.
var g = newGlobal({newCompartment: true});
var dbg = new Debugger(g);
var log;

dbg.onDebuggerStatement = function handleDebugger(frame) {
    log += 'd';
    assertEq(frame.type, "eval");
    frame.onStep = function handleStep() {
        log += 's';
        this.onStep = undefined;
        this.onPop = function handlePop() {
            log += ')';
        };
    };
};

log = "";
g.flag = false;
g.eval('debugger; flag = true');
assertEq(log, 'ds)');
assertEq(g.flag, true);