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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/debug/Frame-onStep-resumption-03.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,19 @@
     1.4 +// If frame.onStep returns null, the debuggee terminates.
     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("h();\n" +
    1.15 +                            "throw 'fail';\n");
    1.16 +        assertEq(rv, null);
    1.17 +    } else {
    1.18 +        frame.older.onStep = function () { return null; };
    1.19 +    }
    1.20 +};
    1.21 +g.h();
    1.22 +assertEq(hits, 2);

mercurial