js/src/jit-test/tests/debug/onExceptionUnwind-08.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-08.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,18 @@
     1.4 +// Ensure that ScriptDebugEpilogue gets called when onExceptionUnwind
     1.5 +// throws an uncaught exception.
     1.6 +var g = newGlobal();
     1.7 +var dbg = Debugger(g);
     1.8 +var frame;
     1.9 +dbg.onExceptionUnwind = function (f, x) {
    1.10 +    frame = f;
    1.11 +    assertEq(frame.live, true);
    1.12 +    throw 'unhandled';
    1.13 +};
    1.14 +dbg.onDebuggerStatement = function(f) {
    1.15 +    assertEq(f.eval('throw 42'), null);
    1.16 +    assertEq(frame.live, false);
    1.17 +};
    1.18 +g.eval('debugger');
    1.19 +
    1.20 +// Don't fail just because we reported an uncaught exception.
    1.21 +quit(0);

mercurial