tor-browser

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

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


      1 // |reftest| async
      2 // This file was procedurally generated from the following sources:
      3 // - src/class-elements/rs-static-method-privatename-identifier-alt.case
      4 // - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template
      5 /*---
      6 description: Valid Static Method PrivateName (field definitions after a static async method in the same line)
      7 esid: prod-FieldDefinition
      8 features: [class-static-methods-private, class, class-fields-public, async-functions]
      9 flags: [generated, async]
     10 includes: [propertyHelper.js]
     11 info: |
     12    ClassElement :
     13      MethodDefinition
     14      static MethodDefinition
     15      FieldDefinition ;
     16      static FieldDefinition ;
     17      ;
     18 
     19    MethodDefinition :
     20      ClassElementName ( UniqueFormalParameters ){ FunctionBody }
     21 
     22    ClassElementName :
     23      PropertyName
     24      PrivateName
     25 
     26    PrivateName ::
     27      # IdentifierName
     28 
     29    IdentifierName ::
     30      IdentifierStart
     31      IdentifierName IdentifierPart
     32 
     33    IdentifierStart ::
     34      UnicodeIDStart
     35      $
     36      _
     37      \ UnicodeEscapeSequence
     38 
     39    IdentifierPart::
     40      UnicodeIDContinue
     41      $
     42      \ UnicodeEscapeSequence
     43      <ZWNJ> <ZWJ>
     44 
     45    UnicodeIDStart::
     46      any Unicode code point with the Unicode property "ID_Start"
     47 
     48    UnicodeIDContinue::
     49      any Unicode code point with the Unicode property "ID_Continue"
     50 
     51 
     52    NOTE 3
     53    The sets of code points with Unicode properties "ID_Start" and
     54    "ID_Continue" include, respectively, the code points with Unicode
     55    properties "Other_ID_Start" and "Other_ID_Continue".
     56 
     57 ---*/
     58 
     59 
     60 class C {
     61  static async m() { return 42; } static #$(value) {
     62    return value;
     63  }
     64  static #_(value) {
     65    return value;
     66  }
     67  static #o(value) {
     68    return value;
     69  }
     70  static #℘(value) {
     71    return value;
     72  }
     73  static #ZW__NJ(value) {
     74    return value;
     75  }
     76  static #ZW__J(value) {
     77    return value;
     78  };
     79  static $(value) {
     80    return this.#$(value);
     81  }
     82  static _(value) {
     83    return this.#_(value);
     84  }
     85  static o(value) {
     86    return this.#o(value);
     87  }
     88  static (value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     89    return this.#℘(value);
     90  }
     91  static ZW_‌_NJ(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     92    return this.#ZW__NJ(value);
     93  }
     94  static ZW_‍_J(value) { // DO NOT CHANGE THE NAME OF THIS FIELD
     95    return this.#ZW__J(value);
     96  }
     97 
     98 }
     99 
    100 var c = new C();
    101 
    102 assert(
    103  !Object.prototype.hasOwnProperty.call(c, "m"),
    104  "m doesn't appear as an own property on the C instance"
    105 );
    106 assert(
    107  !Object.prototype.hasOwnProperty.call(C.prototype, "m"),
    108  "m doesn't appear as an own property on the C prototype"
    109 );
    110 
    111 verifyProperty(C, "m", {
    112  enumerable: false,
    113  configurable: true,
    114  writable: true,
    115 }, {restore: true});
    116 
    117 C.m().then(function(v) {
    118  assert.sameValue(v, 42);
    119 
    120  function assertions() {
    121    // Cover $DONE handler for async cases.
    122    function $DONE(error) {
    123      if (error) {
    124        throw new Test262Error('Test262:AsyncTestFailure')
    125      }
    126    }
    127    assert.sameValue(C.$(1), 1);
    128    assert.sameValue(C._(1), 1);
    129    assert.sameValue(C.o(1), 1);
    130    assert.sameValue(C.(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    131    assert.sameValue(C.ZW_‌_NJ(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    132    assert.sameValue(C.ZW_‍_J(1), 1); // DO NOT CHANGE THE NAME OF THIS FIELD
    133 
    134  }
    135 
    136  return Promise.resolve(assertions());
    137 }).then($DONE, $DONE);