michael@0: // Uncaught exceptions in the debugger itself are delivered to the michael@0: // uncaughtExceptionHook. michael@0: michael@0: var g = newGlobal(); michael@0: var dbg = new Debugger(g); michael@0: var log; michael@0: dbg.onDebuggerStatement = function () { michael@0: log += 'x'; michael@0: throw new TypeError("fail"); michael@0: }; michael@0: dbg.uncaughtExceptionHook = function (exc) { michael@0: assertEq(this, dbg); michael@0: assertEq(exc instanceof TypeError, true); michael@0: log += '!'; michael@0: }; michael@0: michael@0: log = ''; michael@0: g.eval("debugger"); michael@0: assertEq(log, 'x!');