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

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:d4e4925d36a8
1 // addAllGlobalsAsDebuggees adds all the globals as debuggees.
2
3 var g1 = newGlobal(); // Created before the Debugger; debuggee.
4 var g2 = newGlobal(); // Created before the Debugger; not debuggee.
5
6 var dbg = new Debugger;
7
8 var g3 = newGlobal(); // Created after the Debugger; debuggee.
9 var g4 = newGlobal(); // Created after the Debugger; not debuggee.
10
11 var g1w = dbg.addDebuggee(g1);
12 assertEq(dbg.addAllGlobalsAsDebuggees(), undefined);
13
14 // Get Debugger.Objects viewing the globals from their own compartments;
15 // this is the sort that findAllGlobals and addDebuggee return.
16 var g1w = g1w.makeDebuggeeValue(g1).unwrap();
17 var g2w = g1w.makeDebuggeeValue(g2).unwrap();
18 var g3w = g1w.makeDebuggeeValue(g3).unwrap();
19 var g4w = g1w.makeDebuggeeValue(g4).unwrap();
20 var thisw = g1w.makeDebuggeeValue(this).unwrap();
21
22 // Check that they're all there.
23 assertEq(dbg.hasDebuggee(g1w), true);
24 assertEq(dbg.hasDebuggee(g2w), true);
25 assertEq(dbg.hasDebuggee(g3w), true);
26 assertEq(dbg.hasDebuggee(g4w), true);
27 // The debugger's global is not a debuggee.
28 assertEq(dbg.hasDebuggee(thisw), false);

mercurial