tor-browser

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

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


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