js/src/jit-test/tests/baseline/bug842431-3.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/baseline/bug842431-3.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,24 @@
     1.4 +// |jit-test|
     1.5 +
     1.6 +// If an exception unwind hook performs a forced return, and this calls an
     1.7 +// onPop handler that throws, the exception should not be handled in the
     1.8 +// current frame but propagated to the caller.
     1.9 +var g = newGlobal();
    1.10 +var dbg = new Debugger(g);
    1.11 +
    1.12 +g.eval('function f() { try { var y; throw 123; } catch(e) { assertEq(0, 1); } }');
    1.13 +
    1.14 +dbg.onExceptionUnwind = function(frame) {
    1.15 +    frame.onPop = function() {
    1.16 +	return {throw: 321};
    1.17 +    }
    1.18 +
    1.19 +    return {return: 11};
    1.20 +};
    1.21 +
    1.22 +try {
    1.23 +    g.f();
    1.24 +    assertEq(0, 1);
    1.25 +} catch(e) {
    1.26 +    assertEq(e.toString().contains("321"), true);
    1.27 +}

mercurial