Debian Codegraph @

js/src/jit-test/tests/class/classconstructor.js

raw
1 function customconstructor() {
2 class X {
3 constructor() {}
4 a() {}
5 };
6
7 assertEq(Object.getOwnPropertyDescriptor(X, "prototype").configurable, false);
8 assertEq(Object.getOwnPropertyDescriptor(X.prototype, "constructor").enumerable, false);
9 }
10
11 function defaultconstructor() {
12 class X {
13 a() {}
14 };
15
16 assertEq(Object.getOwnPropertyDescriptor(X, "prototype").configurable, false);
17 assertEq(Object.getOwnPropertyDescriptor(X.prototype, "constructor").enumerable, false);
18 }
19
20 function run() {
21 for (var i = 0; i < 100; i++) {
22 customconstructor();
23 defaultconstructor();
24 }
25 }
26
27 run();