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


      1 // |reftest| async
      2 // This file was procedurally generated from the following sources:
      3 // - src/class-elements/rs-field-identifier-initializer.case
      4 // - src/class-elements/productions/cls-decl-after-same-line-static-async-method.template
      5 /*---
      6 description: Valid FieldDefinition (field definitions after a static async method in the same line)
      7 esid: prod-FieldDefinition
      8 features: [class-fields-public, class, async-functions]
      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; } $ = 1; _ = 1; \u{6F} = 1; \u2118 = 1; ZW_\u200C_NJ = 1; ZW_\u200D_J = 1;
     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().then(function(v) {
     84  assert.sameValue(v, 42);
     85 
     86  function assertions() {
     87    // Cover $DONE handler for async cases.
     88    function $DONE(error) {
     89      if (error) {
     90        throw new Test262Error('Test262:AsyncTestFailure')
     91      }
     92    }
     93    assert.sameValue(c.$, 1);
     94    assert.sameValue(c._, 1);
     95    assert.sameValue(c.\u{6F}, 1);
     96    assert.sameValue(c.\u2118, 1);
     97    assert.sameValue(c.ZW_\u200C_NJ, 1);
     98    assert.sameValue(c.ZW_\u200D_J, 1);
     99  }
    100 
    101  return Promise.resolve(assertions());
    102 }).then($DONE, $DONE);