summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/warp/try-finally-unwind.js
blob: 05860fbaa5f3f5ffcf98491711a5787d5f9ea55c (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
let throwing = false;

function bar() {
  with ({}) {}
  if (throwing) throw 3;
}

function foo() {
  let y = 3;
  try {
    let x = 3;
    () => { return x + y; }
    bar();
  } finally {
    assertEq(y, 3);
  }
}

with ({}) {}

for (var i = 0; i < 1000; i++) {
  foo()
}

throwing = true;
try {
  foo();
} catch {}