michael@0: // Errors adding globals in addAllGlobalsAsDebuggees should be reported. michael@0: michael@0: // The exception that might be thrown in this test reflects our inability michael@0: // to change compartments to debug mode while they have frames on the michael@0: // stack. If we run this test with --debugjit, it won't throw an error at michael@0: // all, since all compartments are already in debug mode. So, pass if the michael@0: // script completes normally, or throws an appropriate exception. michael@0: try { michael@0: newGlobal().eval("(new Debugger).addAllGlobalsAsDebuggees();"); michael@0: } catch (ex) { michael@0: assertEq(!!(''+ex).match(/can't start debugging: a debuggee script is on the stack/), true); michael@0: }