js/src/jit-test/tests/debug/uncaughtExceptionHook-resumption-01.js

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

     1 // uncaughtExceptionHook returns a resumption value.
     3 load(libdir + "asserts.js");
     5 var g = newGlobal();
     6 var dbg = new Debugger(g);
     7 var rv;
     8 dbg.onDebuggerStatement = function () { throw 15; };
     9 dbg.uncaughtExceptionHook = function (exc) {
    10     assertEq(exc, 15);
    11     return rv;
    12 };
    14 // case 1: undefined
    15 rv = undefined;
    16 g.eval("debugger");
    18 // case 2: throw
    19 rv = {throw: 57};
    20 var result;
    21 assertThrowsValue(function () { g.eval("debugger"); }, 57);
    23 // case 3: return
    24 rv = {return: 42};
    25 assertEq(g.eval("debugger;"), 42);

mercurial