js/src/jit-test/tests/debug/Debugger-onEnterFrame-resumption-02.js

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 // If debugger.onEnterFrame returns {throw:val}, an exception is thrown in the debuggee.
     3 load(libdir + "asserts.js");
     5 var g = newGlobal();
     6 g.set = false;
     7 g.eval("function f() {\n" +
     8        "    set = true;\n" +
     9        "    return 'fail';\n" +
    10        "}\n");
    12 var dbg = Debugger(g);
    13 var savedFrame;
    14 dbg.onEnterFrame = function (frame) {
    15     savedFrame = frame;
    16     return {throw: "pass"};
    17 };
    19 savedFrame = undefined;
    20 assertThrowsValue(g.f, "pass");
    21 assertEq(savedFrame.live, false);
    22 assertEq(g.set, false);
    24 savedFrame = undefined;
    25 assertThrowsValue(function () { new g.f; }, "pass");
    26 assertEq(savedFrame.live, false);
    27 assertEq(g.set, false);

mercurial