tor-browser

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

after-same-line-static-method-rs-privatename-identifier-alt.js (2502B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/rs-privatename-identifier-alt.case
      3 // - src/class-elements/productions/cls-decl-after-same-line-static-method.template
      4 /*---
      5 description: Valid PrivateName (field definitions after a static method in the same line)
      6 esid: prod-FieldDefinition
      7 features: [class-fields-private, class, class-fields-public]
      8 flags: [generated]
      9 includes: [propertyHelper.js]
     10 info: |
     11    ClassElement :
     12      MethodDefinition
     13      static MethodDefinition
     14      FieldDefinition ;
     15      ;
     16 
     17    FieldDefinition :
     18      ClassElementName Initializer _opt
     19 
     20    ClassElementName :
     21      PropertyName
     22      PrivateName
     23 
     24    PrivateName ::
     25      # IdentifierName
     26 
     27    IdentifierName ::
     28      IdentifierStart
     29      IdentifierName IdentifierPart
     30 
     31    IdentifierStart ::
     32      UnicodeIDStart
     33      $
     34      _
     35      \ UnicodeEscapeSequence
     36 
     37    IdentifierPart::
     38      UnicodeIDContinue
     39      $
     40      \ UnicodeEscapeSequence
     41      <ZWNJ> <ZWJ>
     42 
     43    UnicodeIDStart::
     44      any Unicode code point with the Unicode property "ID_Start"
     45 
     46    UnicodeIDContinue::
     47      any Unicode code point with the Unicode property "ID_Continue"
     48 
     49 
     50    NOTE 3
     51    The sets of code points with Unicode properties "ID_Start" and
     52    "ID_Continue" include, respectively, the code points with Unicode
     53    properties "Other_ID_Start" and "Other_ID_Continue".
     54 
     55 ---*/
     56 
     57 
     58 class C {
     59  static m() { return 42; } #$; #_; #\u{6F}; #℘; #ZW__NJ; #ZW__J;
     60  $(value) {
     61    this.#$ = value;
     62    return this.#$;
     63  }
     64  _(value) {
     65    this.#_ = value;
     66    return this.#_;
     67  }
     68  \u{6F}(value) {
     69    this.#\u{6F} = value;
     70    return this.#\u{6F};
     71  }
     72  (value) {
     73    this.#℘ = value;
     74    return this.#℘;
     75  }
     76  ZW_‌_NJ(value) {
     77    this.#ZW__NJ = value;
     78    return this.#ZW__NJ;
     79  }
     80  ZW_‍_J(value) {
     81    this.#ZW__J = value;
     82    return this.#ZW__J;
     83  }
     84 }
     85 
     86 var c = new C();
     87 
     88 assert.sameValue(C.m(), 42);
     89 assert(
     90  !Object.prototype.hasOwnProperty.call(c, "m"),
     91  "m doesn't appear as an own property on the C instance"
     92 );
     93 assert(
     94  !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
     95  "m doesn't appear as an own property on the C prototype"
     96 );
     97 
     98 verifyProperty(C, "m", {
     99  enumerable: false,
    100  configurable: true,
    101  writable: true,
    102 });
    103 
    104 assert.sameValue(c.$(1), 1);
    105 assert.sameValue(c._(1), 1);
    106 assert.sameValue(c.\u{6F}(1), 1);
    107 assert.sameValue(c.(1), 1);
    108 assert.sameValue(c.ZW_‌_NJ(1), 1);
    109 assert.sameValue(c.ZW_‍_J(1), 1);
    110 
    111 
    112 reportCompare(0, 0);