tor-browser

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

superclass-bound-function.js (801B)


      1 // Copyright (C) 2016 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-runtime-semantics-classdefinitionevaluation
      5 description: SuperClass may be a bound function object
      6 info: |
      7  ClassDefinitionEvaluation
      8 
      9  [...]
     10  5. Else,
     11    [...]
     12    f. Else if IsConstructor(superclass) is false, throw a TypeError exception.
     13    g. Else,
     14      i. Let protoParent be ? Get(superclass, "prototype").
     15      ii. If Type(protoParent) is neither Object nor Null, throw a TypeError exception.
     16      iii. Let constructorParent be superclass.
     17 features: [class]
     18 ---*/
     19 
     20 var bound = function() {}.bind();
     21 bound.prototype = {};
     22 
     23 class C extends bound {}
     24 
     25 assert.sameValue(Object.getPrototypeOf(new C()), C.prototype);
     26 
     27 reportCompare(0, 0);