tor-browser

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

new-sc-line-gen-rs-static-privatename-identifier-alt-by-classname.js (2802B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/rs-static-privatename-identifier-alt-by-classname.case
      3 // - src/class-elements/productions/cls-expr-new-sc-line-generator.template
      4 /*---
      5 description: Valid Static PrivateName (field definitions followed by a method in a new line with a semicolon)
      6 esid: prod-FieldDefinition
      7 features: [class-static-fields-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    FieldDefinition :
     19      ClassElementName Initializer _opt
     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 var C = class {
     60  static #$; static #_; static #\u{6F}; static #℘; static #ZW__NJ; static #ZW__J;
     61  *m() { return 42; }
     62  static $(value) {
     63    C.#$ = value;
     64    return C.#$;
     65  }
     66  static _(value) {
     67    C.#_ = value;
     68    return C.#_;
     69  }
     70  static o(value) {
     71    C.#\u{6F} = value;
     72    return C.#\u{6F};
     73  }
     74  static (value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     75    C.#℘ = value;
     76    return C.#℘;
     77  }
     78  static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     79    C.#ZW__NJ = value;
     80    return C.#ZW__NJ;
     81  }
     82  static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     83    C.#ZW__J = value;
     84    return C.#ZW__J;
     85  }
     86 }
     87 
     88 var c = new C();
     89 
     90 assert.sameValue(c.m().next().value, 42);
     91 assert.sameValue(c.m, C.prototype.m);
     92 assert(
     93  !Object.prototype.hasOwnProperty.call(c, "m"),
     94  "m doesn't appear as an own property on the C instance"
     95 );
     96 
     97 verifyProperty(C.prototype, "m", {
     98  enumerable: false,
     99  configurable: true,
    100  writable: true,
    101 });
    102 
    103 assert.sameValue(C.$(1), 1);
    104 assert.sameValue(C._(1), 1);
    105 assert.sameValue(C.o(1), 1);
    106 assert.sameValue(C.(1), 1);      // DO NOT CHANGE THE NAME OF THIS FIELD
    107 assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    108 assert.sameValue(C.ZW_‍_J(1), 1);  // DO NOT CHANGE THE NAME OF THIS FIELD
    109 
    110 
    111 reportCompare(0, 0);