tor-browser

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

fields-literal-name-static-propname-constructor.js (856B)


      1 // |reftest| error:SyntaxError
      2 // Copyright (C) 2017 Valerie Young. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 /*---
      5 description: static class field forbid PropName 'constructor' (early error -- PropName of IdentifierName is forbidden value)
      6 esid: sec-class-definitions-static-semantics-early-errors
      7 features: [class, class-static-fields-public]
      8 negative:
      9  phase: parse
     10  type: SyntaxError
     11 info: |
     12    Static Semantics: PropName
     13    LiteralPropertyName : IdentifierName
     14      Return StringValue of IdentifierName.
     15 
     16 
     17    // This test file tests the following early error:
     18    Static Semantics: Early Errors
     19 
     20      ClassElement : staticFieldDefinition;
     21        It is a Syntax Error if PropName of FieldDefinition is "prototype" or "constructor".
     22 
     23 ---*/
     24 
     25 
     26 $DONOTEVALUATE();
     27 
     28 class C {
     29  static constructor;
     30 }