summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-identity-02.js
blob: d3f1b94b9ca989def348938fbf2af5beaa286087 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Check that {throw:} resumption kills the current stack frame.

load(libdir + "asserts.js");

var g = newGlobal({newCompartment: true});
g.debuggeeGlobal = this;
g.eval("(" + function () {
        var dbg = new Debugger(debuggeeGlobal);
        var prev = null;
        dbg.onDebuggerStatement = function (frame) {
            assertEq(frame === prev, false);
            if (prev)
                assertEq(prev.onStack, false);
            prev = frame;
            return {throw: debuggeeGlobal.i};
        };
    } + ")();");

function f() { debugger; }
for (var i = 0; i < 10; i++)
    assertThrowsValue(f, i);