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

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

function foo(a) {
  "use strict";
  for (let i = 0; i < 7; i++) {
    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);