summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/class/checkreturn-catch-return.js
blob: 9794dc23b1d74827243ff56fe366ffad09ecf7ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
load(libdir + "asserts.js");

class C extends class {} {
  constructor() {
    super();

    try {
      return 0;
    } catch {
      return;
    }
  }
}

function test() {
  for (var i = 0; i < 100; ++i) {
    assertThrowsInstanceOf(() => new C(), TypeError);
  }
}

test();