tor-browser

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

new-no-sc-line-method-rs-static-generator-method-privatename-identifier-alt.js (2913B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/rs-static-generator-method-privatename-identifier-alt.case
      3 // - src/class-elements/productions/cls-decl-new-no-sc-line-method.template
      4 /*---
      5 description: Valid Static GeneratorMethod PrivateName (field definitions followed by a method in a new line without a semicolon)
      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      GeneratorMethod
     20 
     21    GeneratorMethod :
     22      * ClassElementName ( UniqueFormalParameters ){ GeneratorBody }
     23 
     24    ClassElementName :
     25      PropertyName
     26      PrivateName
     27 
     28    PrivateName ::
     29      # IdentifierName
     30 
     31    IdentifierName ::
     32      IdentifierStart
     33      IdentifierName IdentifierPart
     34 
     35    IdentifierStart ::
     36      UnicodeIDStart
     37      $
     38      _
     39      \ UnicodeEscapeSequence
     40 
     41    IdentifierPart::
     42      UnicodeIDContinue
     43      $
     44      \ UnicodeEscapeSequence
     45      <ZWNJ> <ZWJ>
     46 
     47    UnicodeIDStart::
     48      any Unicode code point with the Unicode property "ID_Start"
     49 
     50    UnicodeIDContinue::
     51      any Unicode code point with the Unicode property "ID_Continue"
     52 
     53 
     54    NOTE 3
     55    The sets of code points with Unicode properties "ID_Start" and
     56    "ID_Continue" include, respectively, the code points with Unicode
     57    properties "Other_ID_Start" and "Other_ID_Continue".
     58 
     59 ---*/
     60 
     61 
     62 class C {
     63  static * #$(value) {
     64    yield * value;
     65  }
     66  static * #_(value) {
     67    yield * value;
     68  }
     69  static * #o(value) {
     70    yield * value;
     71  }
     72  static * #℘(value) {
     73    yield * value;
     74  }
     75  static * #ZW__NJ(value) {
     76    yield * value;
     77  }
     78  static * #ZW__J(value) {
     79    yield * value;
     80  }
     81  m() { return 42; }
     82  static get $() {
     83    return this.#$;
     84  }
     85  static get _() {
     86    return this.#_;
     87  }
     88  static get o() {
     89    return this.#o;
     90  }
     91  static get () { // DO NOT CHANGE THE NAME OF THIS FIELD
     92    return this.#℘;
     93  }
     94  static get ZW_‌_NJ() { // DO NOT CHANGE THE NAME OF THIS FIELD
     95    return this.#ZW__NJ;
     96  }
     97  static get ZW_‍_J() { // DO NOT CHANGE THE NAME OF THIS FIELD
     98    return this.#ZW__J;
     99  }
    100 
    101 }
    102 
    103 var c = new C();
    104 
    105 assert.sameValue(c.m(), 42);
    106 assert.sameValue(c.m, C.prototype.m);
    107 assert(
    108  !Object.prototype.hasOwnProperty.call(c, "m"),
    109  "m doesn't appear as an own property on the C instance"
    110 );
    111 
    112 verifyProperty(C.prototype, "m", {
    113  enumerable: false,
    114  configurable: true,
    115  writable: true,
    116 });
    117 
    118 assert.sameValue(C.$([1]).next().value, 1);
    119 assert.sameValue(C._([1]).next().value, 1);
    120 assert.sameValue(C.o([1]).next().value, 1);
    121 assert.sameValue(C.([1]).next().value, 1);
    122 assert.sameValue(C.ZW_‌_NJ([1]).next().value, 1);
    123 assert.sameValue(C.ZW_‍_J([1]).next().value, 1);
    124 
    125 reportCompare(0, 0);