js/src/jit-test/tests/debug/Frame-onStep-resumption-04.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 // If frame.onStep returns null, debuggee catch and finally blocks are skipped.
     3 var g = newGlobal();
     4 g.eval("function h() { debugger; }");
     6 var dbg = Debugger(g);
     7 var hits = 0;
     8 dbg.onDebuggerStatement = function (frame) {
     9     hits++;
    10     if (hits == 1) {
    11         var rv = frame.eval("try {\n" +
    12                             "    h();\n" +
    13                             "    throw 'fail';\n" +
    14                             "} catch (exc) {\n" +
    15                             "    caught = exc;\n" +
    16                             "} finally {\n" +
    17                             "    finallyHit = true;\n" +
    18                             "}\n");
    19         assertEq(rv, null);
    20     } else {
    21         frame.older.onStep = function () {
    22             this.onStep = undefined;
    23             return null;
    24         };
    25     }
    26 };
    28 g.h();
    29 assertEq(hits, 2);
    30 assertEq("caught" in g, false);
    31 assertEq("finallyHit" in g, false);

mercurial