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-field-identifier.js (2593B)


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