summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/class/bug1720032-3.js
blob: e087e8e0f8ed094e319dbfe3fce2f5387c28c409 (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
function main() {
  class Base {}

  class Derived extends Base {
    constructor() {
      super();

      let v = 0xffff;

      try {
        // Ensure this statement doesn't get DCE'ed.
        v &= 0xff;

        // Calling |super()| twice throws an error.
        super();
      } catch {}

      assertEq(v, 255);
    }
  }

  for (let i = 0; i < 15; i++) {
    new Derived();
  }
}
main();
main();