js/src/jit-test/tests/debug/uncaughtExceptionHook-resumption-02.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 resumption value other than undefined causes further
     2 // hooks to be skipped.
     4 var g = newGlobal();
     5 var log;
     7 function makeDebug(g, name) {
     8     var dbg = new Debugger(g);
     9     dbg.onDebuggerStatement = function (frame) {
    10         log += name;
    11         throw new Error(name);
    12     };
    13     dbg.uncaughtExceptionHook = function (exc) {
    14         assertEq(exc.message, name);
    15         return name == "2" ? {return: 42} : undefined;
    16     };
    17 }
    19 var arr = [];
    20 for (var i = 0; i < 6; i++)
    21     arr[i] = makeDebug(g, "" + i);
    23 log = '';
    24 assertEq(g.eval("debugger;"), 42);
    25 assertEq(log, "012");

mercurial