js/src/jit-test/tests/debug/Frame-onStep-resumption-04.js

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:7bec792cd7e4
1 // If frame.onStep returns null, debuggee catch and finally blocks are skipped.
2
3 var g = newGlobal();
4 g.eval("function h() { debugger; }");
5
6 var dbg = Debugger(g);
7 var hits = 0;
8 dbg.onDebuggerStatement = function (frame) {
9 hits++;
10 if (hits == 1) {
11 var rv = frame.eval("try {\n" +
12 " h();\n" +
13 " throw 'fail';\n" +
14 "} catch (exc) {\n" +
15 " caught = exc;\n" +
16 "} finally {\n" +
17 " finallyHit = true;\n" +
18 "}\n");
19 assertEq(rv, null);
20 } else {
21 frame.older.onStep = function () {
22 this.onStep = undefined;
23 return null;
24 };
25 }
26 };
27
28 g.h();
29 assertEq(hits, 2);
30 assertEq("caught" in g, false);
31 assertEq("finallyHit" in g, false);

mercurial