js/src/jit-test/tests/debug/Frame-onStep-10.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 // Throwing and catching an error in an onStep handler shouldn't interfere
     2 // with throwing and catching in the debuggee.
     4 var g = newGlobal();
     5 g.eval("function f() { debugger; throw 'mud'; }");
     7 var dbg = Debugger(g);
     8 var stepped = false;
     9 dbg.onDebuggerStatement = function (frame) {
    10     frame.older.onStep = function () {
    11         stepped = true;
    12         try {
    13             throw 'snow';
    14         } catch (x) {
    15             assertEq(x, 'snow');
    16         }
    17     };
    18 };
    20 stepped = false;
    21 g.eval("var caught;\n" +
    22        "try {\n" +
    23        "    f();\n" +
    24        "} catch (x) {\n" +
    25        "    caught = x;\n" +
    26        "}\n");
    27 assertEq(stepped, true);
    28 assertEq(g.caught, 'mud');

mercurial