1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/js/src/jit-test/tests/debug/Frame-onStep-resumption-04.js Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,31 @@ 1.4 +// If frame.onStep returns null, debuggee catch and finally blocks are skipped. 1.5 + 1.6 +var g = newGlobal(); 1.7 +g.eval("function h() { debugger; }"); 1.8 + 1.9 +var dbg = Debugger(g); 1.10 +var hits = 0; 1.11 +dbg.onDebuggerStatement = function (frame) { 1.12 + hits++; 1.13 + if (hits == 1) { 1.14 + var rv = frame.eval("try {\n" + 1.15 + " h();\n" + 1.16 + " throw 'fail';\n" + 1.17 + "} catch (exc) {\n" + 1.18 + " caught = exc;\n" + 1.19 + "} finally {\n" + 1.20 + " finallyHit = true;\n" + 1.21 + "}\n"); 1.22 + assertEq(rv, null); 1.23 + } else { 1.24 + frame.older.onStep = function () { 1.25 + this.onStep = undefined; 1.26 + return null; 1.27 + }; 1.28 + } 1.29 +}; 1.30 + 1.31 +g.h(); 1.32 +assertEq(hits, 2); 1.33 +assertEq("caught" in g, false); 1.34 +assertEq("finallyHit" in g, false);