js/src/jit-test/tests/debug/Debugger-debuggees-09.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/Debugger-debuggees-09.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,22 @@
     1.4 +// |jit-test| debug
     1.5 +// If hasDebuggee(x) is false, removeDebuggee(x) does nothing.
     1.6 +
     1.7 +var dbg = new Debugger;
     1.8 +
     1.9 +function check(obj) {
    1.10 +    // If obj is something we could never debug, hasDebuggee(obj) is false.
    1.11 +    assertEq(dbg.hasDebuggee(obj), false);
    1.12 +
    1.13 +    // If hasDebuggee(x) is false, removeDebuggee(x) does nothing.
    1.14 +    assertEq(dbg.removeDebuggee(obj), undefined);
    1.15 +}
    1.16 +
    1.17 +// global objects which happen not to be debuggees at the moment
    1.18 +var g1 = newGlobal('same-compartment');
    1.19 +check(g1);
    1.20 +
    1.21 +// objects in a compartment that is already debugging us
    1.22 +var g2 = newGlobal();
    1.23 +g2.parent = this;
    1.24 +g2.eval("var dbg = new Debugger(parent);");
    1.25 +check(g2);

mercurial