michael@0: // |jit-test| debug michael@0: // Test creating a Debugger in a sandbox, debugging the initial global. michael@0: // michael@0: // This requires debug mode to already be on in the initial global, since it's michael@0: // always on the stack in the shell. Hence the |jit-test| tag. michael@0: michael@0: load(libdir + 'asserts.js'); michael@0: michael@0: var g = newGlobal(); michael@0: g.debuggeeGlobal = this; michael@0: g.eval("var dbg = new Debugger(debuggeeGlobal);"); michael@0: assertEq(g.eval("dbg instanceof Debugger"), true); michael@0: michael@0: // The Debugger constructor from this compartment will not accept as its argument michael@0: // an Object from this compartment. Shenanigans won't fool the membrane. michael@0: g.parent = this; michael@0: assertThrowsInstanceOf(function () { g.eval("parent.Debugger(parent.Object())"); }, TypeError);