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

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

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

with ({}) {}

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

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