js/src/jit-test/tests/debug/Debugger-debuggees-19.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 // removeAllDebuggees removes all the debuggees.
     3 var dbg = new Debugger;
     5 // If we eval in a debuggee, log which debuggee it was.
     6 var log;
     7 dbg.onEnterFrame = function (frame) {
     8   log += 'e';
     9   log += frame.environment.object.label;
    10 };
    12 var g1 = newGlobal();
    13 log = '';
    14 g1.eval('Math');
    15 assertEq(log, '');              // not yet a debuggee
    17 var g1w = dbg.addDebuggee(g1);
    18 assertEq(g1w instanceof Debugger.Object, true);
    19 g1w.label = 'g1';
    20 log = '';
    21 g1.eval('Math');                // now a debuggee
    22 assertEq(log, 'eg1');
    24 var g2 = newGlobal();
    25 log = '';
    26 g1.eval('Math');                // debuggee
    27 g2.eval('Math');                // not a debuggee
    28 assertEq(log, 'eg1');
    30 var g2w = dbg.addDebuggee(g2);
    31 assertEq(g2w instanceof Debugger.Object, true);
    32 g2w.label = 'g2';
    33 log = '';
    34 g1.eval('Math');                // debuggee
    35 g2.eval('this');                // debuggee
    36 assertEq(log, 'eg1eg2');
    38 var a1 = dbg.getDebuggees();
    39 assertEq(a1.length, 2);
    41 assertEq(dbg.removeAllDebuggees(), undefined);
    42 var a2 = dbg.getDebuggees();
    43 assertEq(a2.length, 0);
    45 log = '';
    46 g1.eval('Math');                // no longer a debuggee
    47 g2.eval('this');                // no longer a debuggee
    48 assertEq(log, '');

mercurial