js/src/jit-test/tests/debug/uncaughtExceptionHook-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/uncaughtExceptionHook-03.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,34 @@
     1.4 +// |jit-test| debug; error: ReferenceError
     1.5 +// If uncaughtExceptionHook is absent, the debuggee is terminated.
     1.6 +
     1.7 +var g = newGlobal();
     1.8 +g.debuggeeGlobal = this;
     1.9 +g.eval("(" + function () {
    1.10 +        var dbg = Debugger(debuggeeGlobal);
    1.11 +        dbg.onDebuggerStatement = function (frame) {
    1.12 +            if (frame.callee === null) {
    1.13 +                debuggeeGlobal.log += '1';
    1.14 +                var cv = frame.eval("f();");
    1.15 +                debuggeeGlobal.log += '2';
    1.16 +                assertEq(cv, null);
    1.17 +            } else {
    1.18 +                assertEq(frame.callee.name, "f");
    1.19 +                debuggeeGlobal.log += '3';
    1.20 +                throw new ReferenceError("oops");
    1.21 +            }
    1.22 +        };
    1.23 +    } + ")();");
    1.24 +
    1.25 +function onerror(msg) {
    1.26 +}
    1.27 +
    1.28 +var log = '';
    1.29 +debugger;
    1.30 +function f() {
    1.31 +    try {
    1.32 +        debugger;
    1.33 +    } finally {
    1.34 +        log += 'x';
    1.35 +    }
    1.36 +}
    1.37 +assertEq(log, '132');

mercurial