diff -r 000000000000 -r 6474c204b198 js/src/jit-test/tests/debug/Frame-onStep-10.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/js/src/jit-test/tests/debug/Frame-onStep-10.js Wed Dec 31 06:09:35 2014 +0100 @@ -0,0 +1,28 @@ +// Throwing and catching an error in an onStep handler shouldn't interfere +// with throwing and catching in the debuggee. + +var g = newGlobal(); +g.eval("function f() { debugger; throw 'mud'; }"); + +var dbg = Debugger(g); +var stepped = false; +dbg.onDebuggerStatement = function (frame) { + frame.older.onStep = function () { + stepped = true; + try { + throw 'snow'; + } catch (x) { + assertEq(x, 'snow'); + } + }; +}; + +stepped = false; +g.eval("var caught;\n" + + "try {\n" + + " f();\n" + + "} catch (x) {\n" + + " caught = x;\n" + + "}\n"); +assertEq(stepped, true); +assertEq(g.caught, 'mud');