summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onEnterFrame-resumption-02.js
blob: 9a8778b9cce6662e4cf55ae8f79d1f4a28b49578 (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
25
26
27
28
// If debugger.onEnterFrame returns {throw:val}, an exception is thrown in the debuggee.

load(libdir + "asserts.js");

var g = newGlobal({newCompartment: true});
g.set = false;
g.eval("function f() {\n" +
       "    set = true;\n" +
       "    return 'fail';\n" +
       "}\n");

var dbg = Debugger(g);
var savedFrame;
dbg.onEnterFrame = function (frame) {
    savedFrame = frame;
    return {throw: "pass"};
};

savedFrame = undefined;
assertThrowsValue(g.f, "pass");
assertEq(savedFrame.onStack, false);
assertEq(g.set, false);

savedFrame = undefined;
assertThrowsValue(function () { new g.f; }, "pass");
assertEq(savedFrame.onStack, false);
assertEq(g.set, false);