js/src/jit-test/tests/debug/Source-introductionScript-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 // We don't record introduction scripts in a different global from the
     2 // introduced script, even if they're both debuggees.
     4 var dbg = new Debugger;
     6 var g1 = newGlobal();
     7 g1.g1 = g1;
     8 var g1DO = dbg.addDebuggee(g1);
    10 var g2 = newGlobal();
    11 g2.g1 = g1;
    13 var log = '';
    14 dbg.onDebuggerStatement = function (frame) {
    15   log += 'd';
    16   assertEq(frame.script.source.introductionScript, undefined);
    17   assertEq(frame.script.source.introductionOffset, undefined);
    18 };
    20 g2.eval('g1.eval("debugger;");');
    21 assertEq(log, 'd');
    23 // Just for sanity: when it's not cross-global, we do note the introducer.
    24 log = '';
    25 dbg.onDebuggerStatement = function (frame) {
    26   log += 'd';
    27   assertEq(frame.script.source.introductionScript instanceof Debugger.Script, true);
    28   assertEq(typeof frame.script.source.introductionOffset, "number");
    29 };
    30 // Exactly as above, but with g1 instead of g2.
    31 g1.eval('g1.eval("debugger;");');
    32 assertEq(log, 'd');

mercurial