summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onPop-02.js
blob: 28d9cef8b449e9f830647f3a064987a4bc46e8d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Clearing a frame's onPop handler works.
var g = newGlobal();
g.eval("function f() { debugger; }");
var dbg = new Debugger(g);

var log;
dbg.onEnterFrame = function handleEnter(f) {
    log += "(";
    f.onPop = function handlePop() {
        assertEq("handlePop was called", "handlePop should never be called");
    };
};
dbg.onDebuggerStatement = function handleDebugger(f) {
    log += "d";
    assertEq(typeof f.onPop, "function");
    f.onPop = undefined;
};
log = '';
g.f();
assertEq(log, "(d");