js/src/jit-test/tests/debug/Source-introductionScript-03.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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