summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/basic/bug1759029-1.js
blob: 2f379cab5c937a492814bdcd3c220dc6f60ab76b (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
// |jit-test| --fast-warmup; --no-threads

var arr = [];
arr[0] = 1;
arr[NaN] = 0;

function foo() {
  for (let i = 0; i < 7; i++) {
    const a = i % i;
    counter += a >>> a;

    try {
      throw 3;
    } catch {
      counter += arr[a];
    }
  }
  for (let i = 0; i < 100; i++) { }
}

let counter = 0;
for (var i = 0; i < 10; i++) {
  foo();
}

assertEq(counter, 60);