michael@0: function run_test() michael@0: { michael@0: Components.utils.import("resource://gre/modules/jsdebugger.jsm"); michael@0: addDebuggerToGlobal(this); michael@0: var xpcInspector = Cc["@mozilla.org/jsinspector;1"].getService(Ci.nsIJSInspector); michael@0: var g = testGlobal("test1"); michael@0: michael@0: var dbg = new Debugger(); michael@0: dbg.uncaughtExceptionHook = testExceptionHook; michael@0: michael@0: dbg.addDebuggee(g); michael@0: dbg.onDebuggerStatement = function(aFrame) { michael@0: do_check_true(aFrame === dbg.getNewestFrame()); michael@0: // Execute from the nested event loop, dbg.getNewestFrame() won't michael@0: // be working anymore. michael@0: michael@0: do_execute_soon(function() { michael@0: try { michael@0: do_check_true(aFrame === dbg.getNewestFrame()); michael@0: } finally { michael@0: xpcInspector.exitNestedEventLoop("test"); michael@0: } michael@0: }); michael@0: xpcInspector.enterNestedEventLoop("test"); michael@0: }; michael@0: michael@0: g.eval("function debuggerStatement() { debugger; }; debuggerStatement();"); michael@0: michael@0: dbg.enabled = false; michael@0: }