tor-browser

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

multiple-stacked-definitions-rs-static-method-privatename-identifier-alt.js (3426B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/rs-static-method-privatename-identifier-alt.case
      3 // - src/class-elements/productions/cls-decl-multiple-stacked-definitions.template
      4 /*---
      5 description: Valid Static Method PrivateName (multiple stacked fields definitions through ASI)
      6 esid: prod-FieldDefinition
      7 features: [class-static-methods-private, class, class-fields-public]
      8 flags: [generated]
      9 includes: [propertyHelper.js]
     10 info: |
     11    ClassElement :
     12      MethodDefinition
     13      static MethodDefinition
     14      FieldDefinition ;
     15      static FieldDefinition ;
     16      ;
     17 
     18    MethodDefinition :
     19      ClassElementName ( UniqueFormalParameters ){ FunctionBody }
     20 
     21    ClassElementName :
     22      PropertyName
     23      PrivateName
     24 
     25    PrivateName ::
     26      # IdentifierName
     27 
     28    IdentifierName ::
     29      IdentifierStart
     30      IdentifierName IdentifierPart
     31 
     32    IdentifierStart ::
     33      UnicodeIDStart
     34      $
     35      _
     36      \ UnicodeEscapeSequence
     37 
     38    IdentifierPart::
     39      UnicodeIDContinue
     40      $
     41      \ UnicodeEscapeSequence
     42      <ZWNJ> <ZWJ>
     43 
     44    UnicodeIDStart::
     45      any Unicode code point with the Unicode property "ID_Start"
     46 
     47    UnicodeIDContinue::
     48      any Unicode code point with the Unicode property "ID_Continue"
     49 
     50 
     51    NOTE 3
     52    The sets of code points with Unicode properties "ID_Start" and
     53    "ID_Continue" include, respectively, the code points with Unicode
     54    properties "Other_ID_Start" and "Other_ID_Continue".
     55 
     56 ---*/
     57 
     58 
     59 class C {
     60  static #$(value) {
     61    return value;
     62  }
     63  static #_(value) {
     64    return value;
     65  }
     66  static #o(value) {
     67    return value;
     68  }
     69  static #℘(value) {
     70    return value;
     71  }
     72  static #ZW__NJ(value) {
     73    return value;
     74  }
     75  static #ZW__J(value) {
     76    return value;
     77  }
     78  foo = "foobar"
     79  bar = "barbaz";
     80  static $(value) {
     81    return this.#$(value);
     82  }
     83  static _(value) {
     84    return this.#_(value);
     85  }
     86  static o(value) {
     87    return this.#o(value);
     88  }
     89  static (value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     90    return this.#℘(value);
     91  }
     92  static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     93    return this.#ZW__NJ(value);
     94  }
     95  static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     96    return this.#ZW__J(value);
     97  }
     98 
     99 }
    100 
    101 var c = new C();
    102 
    103 assert.sameValue(c.foo, "foobar");
    104 assert(
    105  !Object.prototype.hasOwnProperty.call(C, "foo"),
    106  "foo doesn't appear as an own property on the C constructor"
    107 );
    108 assert(
    109  !Object.prototype.hasOwnProperty.call(C.prototype, "foo"),
    110  "foo doesn't appear as an own property on the C prototype"
    111 );
    112 
    113 verifyProperty(c, "foo", {
    114  value: "foobar",
    115  enumerable: true,
    116  configurable: true,
    117  writable: true,
    118 });
    119 
    120 assert.sameValue(c.bar, "barbaz");
    121 assert(
    122  !Object.prototype.hasOwnProperty.call(C, "bar"),
    123  "bar doesn't appear as an own property on the C constructor"
    124 );
    125 assert(
    126  !Object.prototype.hasOwnProperty.call(C.prototype, "bar"),
    127  "bar doesn't appear as an own property on the C prototype"
    128 );
    129 
    130 verifyProperty(c, "bar", {
    131  value: "barbaz",
    132  enumerable: true,
    133  configurable: true,
    134  writable: true,
    135 });
    136 
    137 assert.sameValue(C.$(1), 1);
    138 assert.sameValue(C._(1), 1);
    139 assert.sameValue(C.o(1), 1);
    140 assert.sameValue(C.(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    141 assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    142 assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    143 
    144 
    145 reportCompare(0, 0);