tor-browser

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

field-definition-accessor-no-line-terminator.js (1507B)


      1 // |reftest| skip-if(!(this.hasOwnProperty('getBuildConfiguration')&&getBuildConfiguration('decorators'))) -- decorators is not enabled unconditionally
      2 // This file was procedurally generated from the following sources:
      3 // - src/class-elements/field-definition-accessor-no-line-terminator.case
      4 // - src/class-elements/default/cls-decl.template
      5 /*---
      6 description: Valid accessor FieldDefinition, ClassElementName, PropertyName Syntax (field definitions in a class declaration)
      7 esid: prod-FieldDefinition
      8 features: [decorators, class]
      9 flags: [generated]
     10 info: |
     11    FieldDefinition[Yield, Await] :
     12      accessor [no LineTerminator here] ClassElementName[?Yield, ?Await] Initializer[+In, ?Yield, ?Await]opt
     13 
     14 ---*/
     15 
     16 
     17 class C {
     18  accessor
     19  $;
     20  static accessor
     21  $;
     22 
     23 }
     24 
     25 let c = new C();
     26 
     27 assert(
     28  !Object.prototype.hasOwnProperty.call(C.prototype, 'accessor'),
     29  "accessor doesn't appear as an own property on C prototype"
     30 );
     31 assert(
     32  !Object.prototype.hasOwnProperty.call(C.prototype, '$'),
     33  "$ doesn't appear as an own property on C prototype"
     34 );
     35 assert(
     36  Object.prototype.hasOwnProperty.call(C, 'accessor'),
     37  "C constructor has an own property accessor"
     38 );
     39 assert(
     40  !Object.prototype.hasOwnProperty.call(C, '$'),
     41  "$ doesn't appear as an own property on C constructor"
     42 );
     43 assert(
     44  Object.prototype.hasOwnProperty.call(c, 'accessor'),
     45  "C instance has an own property accessor"
     46 );
     47 assert(
     48  Object.prototype.hasOwnProperty.call(c, '$'),
     49  "C instance has an own property $"
     50 );
     51 
     52 reportCompare(0, 0);