tor-browser

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

member-expression-async-this.js (586B)


      1 // |reftest| async
      2 // Copyright 2019 Google, Inc.  All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 /*---
      5 esid: prod-OptionalExpression
      6 description: >
      7  optional chain on member expression in async context
      8 info: |
      9  Left-Hand-Side Expressions
     10    OptionalExpression:
     11      MemberExpression [PrimaryExpression this] OptionalChain
     12 features: [optional-chaining]
     13 flags: [async]
     14 ---*/
     15 
     16 async function thisFn() {
     17  return await this?.a
     18 }
     19 thisFn.call({a: Promise.resolve(33)}).then(function(arg) {
     20  assert.sameValue(33, arg);
     21 }).then($DONE, $DONE);