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-private-method-alt.js (2808B)


      1 // This file was procedurally generated from the following sources:
      2 // - src/class-elements/rs-private-method-alt.case
      3 // - src/class-elements/productions/cls-expr-after-same-line-static-method.template
      4 /*---
      5 description: Valid PrivateName as private method (field definitions after a static method in the same line)
      6 esid: prod-FieldDefinition
      7 features: [class-methods-private, class-fields-private, class, class-fields-public]
      8 flags: [generated]
      9 includes: [propertyHelper.js]
     10 info: |
     11    ClassElement :
     12      MethodDefinition
     13      ...
     14      ;
     15 
     16    MethodDefinition :
     17      ClassElementName ( UniqueFormalParameters ) { FunctionBody }
     18      ...
     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    NOTE 3
     50    The sets of code points with Unicode properties "ID_Start" and
     51    "ID_Continue" include, respectively, the code points with Unicode
     52    properties "Other_ID_Start" and "Other_ID_Continue".
     53 
     54 ---*/
     55 
     56 
     57 var C = class {
     58  static m() { return 42; } #$_; #__; #\u{6F}_; #℘_; #ZW__NJ_; #ZW__J_;
     59  #$() {
     60    return this.#$_;
     61  }
     62  #_() {
     63    return this.#__;
     64  }
     65  #\u{6F}() {
     66    return this.#\u{6F}_;
     67  }
     68  #℘() {
     69    return this.#℘_;
     70  }
     71  #ZW__NJ() {
     72    return this.#ZW__NJ_;
     73  }
     74  #ZW__J() {
     75    return this.#ZW__J_;
     76  }
     77 ;
     78  $(value) {
     79    this.#$_ = value;
     80    return this.#$();
     81  }
     82  _(value) {
     83    this.#__ = value;
     84    return this.#_();
     85  }
     86  \u{6F}(value) {
     87    this.#\u{6F}_ = value;
     88    return this.#\u{6F}();
     89  }
     90  (value) {
     91    this.#℘_ = value;
     92    return this.#℘();
     93  }
     94  ZW_‌_NJ(value) {
     95    this.#ZW__NJ_ = value;
     96    return this.#ZW__NJ();
     97  }
     98  ZW_‍_J(value) {
     99    this.#ZW__J_ = value;
    100    return this.#ZW__J();
    101  }
    102 
    103 }
    104 
    105 var c = new C();
    106 
    107 assert.sameValue(C.m(), 42);
    108 assert(
    109  !Object.prototype.hasOwnProperty.call(c, "m"),
    110  "m doesn't appear as an own property on the C instance"
    111 );
    112 assert(
    113  !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
    114  "m doesn't appear as an own property on the C prototype"
    115 );
    116 
    117 verifyProperty(C, "m", {
    118  enumerable: false,
    119  configurable: true,
    120  writable: true,
    121 });
    122 
    123 assert.sameValue(c.$(1), 1);
    124 assert.sameValue(c._(1), 1);
    125 assert.sameValue(c.\u{6F}(1), 1);
    126 assert.sameValue(c.(1), 1);
    127 assert.sameValue(c.ZW_‌_NJ(1), 1);
    128 assert.sameValue(c.ZW_‍_J(1), 1);
    129 
    130 reportCompare(0, 0);