1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Debugger-debuggees-20.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,28 @@ 1.4 +// addAllGlobalsAsDebuggees adds all the globals as debuggees. 1.5 + 1.6 +var g1 = newGlobal(); // Created before the Debugger; debuggee. 1.7 +var g2 = newGlobal(); // Created before the Debugger; not debuggee. 1.8 + 1.9 +var dbg = new Debugger; 1.10 + 1.11 +var g3 = newGlobal(); // Created after the Debugger; debuggee. 1.12 +var g4 = newGlobal(); // Created after the Debugger; not debuggee. 1.13 + 1.14 +var g1w = dbg.addDebuggee(g1); 1.15 +assertEq(dbg.addAllGlobalsAsDebuggees(), undefined); 1.16 + 1.17 +// Get Debugger.Objects viewing the globals from their own compartments; 1.18 +// this is the sort that findAllGlobals and addDebuggee return. 1.19 +var g1w = g1w.makeDebuggeeValue(g1).unwrap(); 1.20 +var g2w = g1w.makeDebuggeeValue(g2).unwrap(); 1.21 +var g3w = g1w.makeDebuggeeValue(g3).unwrap(); 1.22 +var g4w = g1w.makeDebuggeeValue(g4).unwrap(); 1.23 +var thisw = g1w.makeDebuggeeValue(this).unwrap(); 1.24 + 1.25 +// Check that they're all there. 1.26 +assertEq(dbg.hasDebuggee(g1w), true); 1.27 +assertEq(dbg.hasDebuggee(g2w), true); 1.28 +assertEq(dbg.hasDebuggee(g3w), true); 1.29 +assertEq(dbg.hasDebuggee(g4w), true); 1.30 +// The debugger's global is not a debuggee. 1.31 +assertEq(dbg.hasDebuggee(thisw), false);