summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onStep-resumption-04.js
blob: d557152a1424ef58b2db378f6fee0ba2d2aa79fd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// If frame.onStep returns null, debuggee catch and finally blocks are skipped.

var g = newGlobal({newCompartment: true});
g.eval("function h() { debugger; }");

var dbg = Debugger(g);
var hits = 0;
dbg.onDebuggerStatement = function (frame) {
    hits++;
    if (hits == 1) {
        var rv = frame.eval("try {\n" +
                            "    h();\n" +
                            "    throw 'fail';\n" +
                            "} catch (exc) {\n" +
                            "    caught = exc;\n" +
                            "} finally {\n" +
                            "    finallyHit = true;\n" +
                            "}\n");
        assertEq(rv, null);
    } else {
        frame.older.onStep = function () {
            this.onStep = undefined;
            return null;
        };
    }
};

g.h();
assertEq(hits, 2);
assertEq("caught" in g, false);
assertEq("finallyHit" in g, false);