tor-browser

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

member-expression-async-literal.js (611B)


      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 literal] OptionalChain
     12 features: [optional-chaining]
     13 flags: [async]
     14 includes: [asyncHelpers.js]
     15 ---*/
     16 
     17 async function checkAssertions() {
     18  assert.sameValue(await "hello"?.[0], 'h');
     19  assert.sameValue(await null?.a, undefined);
     20 }
     21 asyncTest(checkAssertions);