michael@0: // Throwing and catching an error in an onStep handler shouldn't interfere michael@0: // with throwing and catching in the debuggee. michael@0: michael@0: var g = newGlobal(); michael@0: g.eval("function f() { debugger; throw 'mud'; }"); michael@0: michael@0: var dbg = Debugger(g); michael@0: var stepped = false; michael@0: dbg.onDebuggerStatement = function (frame) { michael@0: frame.older.onStep = function () { michael@0: stepped = true; michael@0: try { michael@0: throw 'snow'; michael@0: } catch (x) { michael@0: assertEq(x, 'snow'); michael@0: } michael@0: }; michael@0: }; michael@0: michael@0: stepped = false; michael@0: g.eval("var caught;\n" + michael@0: "try {\n" + michael@0: " f();\n" + michael@0: "} catch (x) {\n" + michael@0: " caught = x;\n" + michael@0: "}\n"); michael@0: assertEq(stepped, true); michael@0: assertEq(g.caught, 'mud');