michael@0: // If the debuggee cannot be put into debug mode, throw. michael@0: michael@0: // Run this test only if this compartment can't be put into debug mode. michael@0: var canEnable = true; michael@0: if (typeof setDebugMode === 'function') { michael@0: try { michael@0: setDebugMode(true); michael@0: } catch (exc) { michael@0: canEnable = false; michael@0: } michael@0: } michael@0: michael@0: if (!canEnable) { michael@0: var g = newGlobal(); michael@0: g.libdir = libdir; michael@0: g.eval("load(libdir + 'asserts.js');"); michael@0: g.parent = this; michael@0: g.eval("assertThrowsInstanceOf(function () { new Debugger(parent); }, Error);"); michael@0: }