1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Debugger-debuggees-21.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,12 @@ 1.4 +// Errors adding globals in addAllGlobalsAsDebuggees should be reported. 1.5 + 1.6 +// The exception that might be thrown in this test reflects our inability 1.7 +// to change compartments to debug mode while they have frames on the 1.8 +// stack. If we run this test with --debugjit, it won't throw an error at 1.9 +// all, since all compartments are already in debug mode. So, pass if the 1.10 +// script completes normally, or throws an appropriate exception. 1.11 +try { 1.12 + newGlobal().eval("(new Debugger).addAllGlobalsAsDebuggees();"); 1.13 +} catch (ex) { 1.14 + assertEq(!!(''+ex).match(/can't start debugging: a debuggee script is on the stack/), true); 1.15 +}