js/src/jit-test/tests/debug/Debugger-debuggees-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 // hasDebuggee tests.
     3 var g1 = newGlobal(), g1w;
     4 g1.eval("var g2 = newGlobal('same-compartment')");
     5 var g2 = g1.g2;
     6 var g1w, g2w;
     8 var dbg = new Debugger;
     9 function checkHas(hasg1, hasg2) {
    10     assertEq(dbg.hasDebuggee(g1), hasg1);
    11     if (typeof g1w === 'object')
    12         assertEq(dbg.hasDebuggee(g1w), hasg1);
    13     assertEq(dbg.hasDebuggee(g2), hasg2);
    14     if (typeof g2w === 'object')
    15         assertEq(dbg.hasDebuggee(g2w), hasg2);
    16 }
    18 checkHas(false, false);
    19 g1w = dbg.addDebuggee(g1);
    20 checkHas(true, false);
    21 g2w = dbg.addDebuggee(g2);
    22 checkHas(true, true);
    23 dbg.removeDebuggee(g1w);
    24 checkHas(false, true);
    25 dbg.removeDebuggee(g2);
    26 checkHas(false, false);

mercurial