summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/baseline/classConstructor-AnyScripted.js
blob: 8acb052c74699f504c79897e4ebf804d35894832 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
function test(fun) {
    fun();
}

// Generate a CallAnyScripted stub in test()
for (let i = 0; i < 20; i++) {
    test(function() { /* wheeee */ });
}

class foo {
    constructor() { }
}

// Compile foo()
for (let i = 0; i < 11; i++)
    new foo();

try {
    test(foo);
    throw new Error("Invoking a class constructor without new must throw");
} catch (e if e instanceof TypeError) { }