tor-browser

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

class-expression-binding-identifier-opt-class-element-list.js (949B)


      1 // Copyright (C) 2015 the V8 project authors. All rights reserved.
      2 // This code is governed by the BSD license found in the LICENSE file.
      3 /*---
      4 es6id: 14.5
      5 description: >
      6    ClassExpression[Yield,GeneratorParameter] :
      7      class BindingIdentifier[?Yield]opt ClassTail[?Yield,?GeneratorParameter]
      8 
      9    ClassDeclaration:
     10      class BindingIdentifier ClassTail
     11 
     12    ClassTail:
     13      ... { ClassBodyopt }
     14 
     15    ClassBody[Yield] :
     16      ClassElementList[?Yield]
     17 
     18 
     19    ClassElementList[Yield] :
     20      ClassElement[?Yield]
     21      ClassElementList[?Yield] ClassElement[?Yield]
     22 
     23    ClassElement[Yield] :
     24      MethodDefinition[?Yield]
     25      static MethodDefinition[?Yield]
     26      ;
     27 
     28 ---*/
     29 var A = class B {
     30  method() {}
     31  static method() {}
     32  ;
     33 }
     34 
     35 assert.sameValue(typeof A, "function");
     36 assert.sameValue(typeof A.prototype.method, "function");
     37 assert.sameValue(typeof A.method, "function");
     38 
     39 assert.sameValue(typeof B, "undefined");
     40 
     41 reportCompare(0, 0);