tor-browser

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

in-constructor.js (508B)


      1 // Copyright (C) 2014 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 esid: sec-makesuperpropertyreference
      5 description: >
      6    class super in constructor
      7 ---*/
      8 var calls = 0;
      9 class B {}
     10 B.prototype.x = 42;
     11 
     12 class C extends B {
     13  constructor() {
     14    super();
     15    calls++;
     16    assert.sameValue(super.x, 42, "The value of `super.x` is `42`");
     17  }
     18 }
     19 
     20 new C;
     21 assert.sameValue(calls, 1, "The value of `calls` is `1`");
     22 
     23 reportCompare(0, 0);