js/src/jit-test/tests/ion/try-catch-4.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit-test/tests/ion/try-catch-4.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,15 @@
     1.4 +// Entering catch blocks via OSR is not possible (because the catch block
     1.5 +// is not compiled by Ion). Don't crash.
     1.6 +function f() {
     1.7 +    var res = 0;
     1.8 +    try {
     1.9 +	throw 1;
    1.10 +    } catch(e) {
    1.11 +	for (var i=0; i<10; i++) {
    1.12 +	    res += 3;
    1.13 +	}
    1.14 +    }
    1.15 +
    1.16 +    assertEq(res, 30);
    1.17 +}
    1.18 +f();

mercurial