summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/baseline/try-finally-1.js
blob: 8ce4f5a89bf60f8aeaa21912b2cba904c476708f (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
28
function test1() {
    try {
	return "try";
    } finally {
	return "finally";
    }
}
assertEq(test1(), "finally");

function test2() {
    try {
	throw 4;
    } catch(e) {
	return "catch";
    } finally {
	return "finally";
    }
}
assertEq(test2(), "finally");

function test3() {
    try {
	throw 4;
    } finally {
	return "finally"; // Don't rethrow.
    }
}
assertEq(test3(), "finally");