/js/src/jit-test/tests/debug/Frame-onStep-10.js
http://github.com/zpao/v8monkey · JavaScript · 28 lines · 23 code · 3 blank · 2 comment · 0 complexity · a4cbc3f293ed54ce0cfa0b21b8f97002 MD5 · raw file
- // Throwing and catching an error in an onStep handler shouldn't interfere
- // with throwing and catching in the debuggee.
- var g = newGlobal('new-compartment');
- 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');