js/src/jit-test/tests/debug/Debugger-findAllGlobals-02.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.

michael@0 1 // Debugger.prototype.findAllGlobals finds ALL the globals!
michael@0 2
michael@0 3 var g1 = newGlobal(); // Created before the Debugger; debuggee.
michael@0 4 var g2 = newGlobal(); // Created before the Debugger; not debuggee.
michael@0 5
michael@0 6 var dbg = new Debugger;
michael@0 7
michael@0 8 var g3 = newGlobal(); // Created after the Debugger; debuggee.
michael@0 9 var g4 = newGlobal(); // Created after the Debugger; not debuggee.
michael@0 10
michael@0 11 var g1w = dbg.addDebuggee(g1);
michael@0 12 var g3w = dbg.addDebuggee(g3);
michael@0 13
michael@0 14 var a = dbg.findAllGlobals();
michael@0 15
michael@0 16 // Get Debugger.Objects viewing the globals from their own compartments;
michael@0 17 // this is the sort that findAllGlobals and addDebuggee return.
michael@0 18 var g2w = g1w.makeDebuggeeValue(g2).unwrap();
michael@0 19 var g4w = g1w.makeDebuggeeValue(g4).unwrap();
michael@0 20 var thisw = g1w.makeDebuggeeValue(this).unwrap();
michael@0 21
michael@0 22 // Check that they're all there.
michael@0 23 assertEq(a.indexOf(g1w) != -1, true);
michael@0 24 assertEq(a.indexOf(g2w) != -1, true);
michael@0 25 assertEq(a.indexOf(g3w) != -1, true);
michael@0 26 assertEq(a.indexOf(g4w) != -1, true);
michael@0 27 assertEq(a.indexOf(thisw) != -1, true);

mercurial