js/src/jit-test/tests/debug/Debugger-multi-03.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 // Q: But who shall debug the debuggers?  A: jimb
     3 var log = '';
     5 function addDebug(g, id) {
     6     var debuggerGlobal = newGlobal();
     7     debuggerGlobal.debuggee = g;
     8     debuggerGlobal.id = id;
     9     debuggerGlobal.print = function (s) { log += s; };
    10     debuggerGlobal.eval(
    11         'var dbg = new Debugger(debuggee);\n' +
    12         'dbg.onDebuggerStatement = function () { print(id); debugger; print(id); };\n');
    13     return debuggerGlobal;
    14 }
    16 var base = newGlobal();
    17 var top = base;
    18 for (var i = 0; i < 8; i++)  // why have 2 debuggers when you can have 8
    19     top = addDebug(top, i);
    20 base.eval("debugger;");
    21 assertEq(log, '0123456776543210');

mercurial