summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/ion/try-catch-3.js
blob: 53b6babe181d9312044d59c5db99bf62ff57130b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Don't fail if code after try statement is unreachable.
function f() {
    try {
	throw 1;
    } catch(e) {
	throw 5;
    }

    // Unreachable.
    assertEq(0, 2);
    var res = 0;
    for (var i=0; i<10; i++)
	res += 2;
    return res;
}

var c = 0;

for (var i=0; i<5; i++) {
    try {
	f();
	assertEq(0, 1);
    } catch(e) {
	c += e;
    }
}
assertEq(c, 25);