js/src/jit-test/tests/debug/onExceptionUnwind-04.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/onExceptionUnwind-04.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,17 @@
     1.4 +// onExceptionUnwind is not called for exceptions thrown and handled in the debugger.
     1.5 +var g = newGlobal();
     1.6 +var dbg = Debugger(g);
     1.7 +g.log = '';
     1.8 +dbg.onDebuggerStatement = function (frame) {
     1.9 +    try {
    1.10 +        throw new Error("oops");
    1.11 +    } catch (exc) {
    1.12 +        g.log += exc.message;
    1.13 +    }
    1.14 +};
    1.15 +dbg.onExceptionUnwind = function (frame) {
    1.16 +    g.log += 'BAD';
    1.17 +};
    1.18 +
    1.19 +g.eval("debugger; log += ' ok';");
    1.20 +assertEq(g.log, 'oops ok');

mercurial