summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Debugger-onEnterFrame-resumption-02.js
blob: 2b8ea2ff361fb15f08b9d0bdaecb0c3f1d7b497f (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();
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.live, false);
assertEq(g.set, false);

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