summaryrefslogtreecommitdiffstats
path: root/js/src/jit-test/tests/class/classconstructor.js
blob: 2d926b48ca0c55879f5015de8e0cca452f930033 (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 customconstructor() {
    class X {
        constructor() {}
        a() {}
    };

    assertEq(Object.getOwnPropertyDescriptor(X, "prototype").configurable, false);
    assertEq(Object.getOwnPropertyDescriptor(X.prototype, "constructor").enumerable, false);
}

function defaultconstructor() {
    class X {
        a() {}
    };

    assertEq(Object.getOwnPropertyDescriptor(X, "prototype").configurable, false);
    assertEq(Object.getOwnPropertyDescriptor(X.prototype, "constructor").enumerable, false);
}

function run() {
    for (var i = 0; i < 100; i++) {
        customconstructor();
        defaultconstructor();
    }
}

run();