diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/debug/Debugger-ctor-03.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/debug/Debugger-ctor-03.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,19 @@ +// If the debuggee cannot be put into debug mode, throw. + +// Run this test only if this compartment can't be put into debug mode. +var canEnable = true; +if (typeof setDebugMode === 'function') { + try { + setDebugMode(true); + } catch (exc) { + canEnable = false; + } +} + +if (!canEnable) { + var g = newGlobal(); + g.libdir = libdir; + g.eval("load(libdir + 'asserts.js');"); + g.parent = this; + g.eval("assertThrowsInstanceOf(function () { new Debugger(parent); }, Error);"); +}