summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/debug/Frame-onStep-resumption-04.js
blob: 07f2d5c0e49cff9f4804f408a380a2a0c30419e3 (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();
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);