tor-browser

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

same-line-gen-rs-static-method-privatename-identifier-alt.js (2923B)


      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-same-line-generator.template
      4 /*---
      5 description: Valid Static Method PrivateName (field definitions followed by a generator method in the same line)
      6 esid: prod-FieldDefinition
      7 features: [class-static-methods-private, class, class-fields-public, generators]
      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  }; *m() { return 42; }
     78  static $(value) {
     79    return this.#$(value);
     80  }
     81  static _(value) {
     82    return this.#_(value);
     83  }
     84  static o(value) {
     85    return this.#o(value);
     86  }
     87  static (value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     88    return this.#℘(value);
     89  }
     90  static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     91    return this.#ZW__NJ(value);
     92  }
     93  static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     94    return this.#ZW__J(value);
     95  }
     96 
     97 }
     98 
     99 var c = new C();
    100 
    101 assert.sameValue(c.m().next().value, 42);
    102 assert.sameValue(c.m, C.prototype.m);
    103 assert(
    104  !Object.prototype.hasOwnProperty.call(c, "m"),
    105  "m doesn't appear as an own property on the C instance"
    106 );
    107 
    108 verifyProperty(C.prototype, "m", {
    109  enumerable: false,
    110  configurable: true,
    111  writable: true,
    112 });
    113 
    114 assert.sameValue(C.$(1), 1);
    115 assert.sameValue(C._(1), 1);
    116 assert.sameValue(C.o(1), 1);
    117 assert.sameValue(C.(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    118 assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    119 assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    120 
    121 
    122 reportCompare(0, 0);