tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

classconstructor.js (648B)


      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();