summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onPop-12.js
blob: 044c23b6da084d79f8220eb6fe8c6a1272b917cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Setting an onPop handler from an onPop handler doesn't throw, but the
// new handler doesn't fire.
var g = newGlobal();
var dbg = new Debugger(g);
var log;

dbg.onDebuggerStatement = function handleDebugger(frame) {
    log += 'd';
    assertEq(frame.type, "eval");
    frame.onPop = function firstHandlePop(c) {
        log +=')';
        assertEq(c.return, 'on investment');
        this.onPop = function secondHandlePop(c) {
            assertEq("secondHandlePop was called", "secondHandlePop should never be called");
        };
    };
};

log = "";
g.eval("debugger; 'on investment';");
assertEq(log, 'd)');