tor-browser

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

void-await-expr.js (666B)


      1 // |reftest| module async
      2 // Copyright (C) 2019 Leo Balter. All rights reserved.
      3 // This code is governed by the BSD license found in the LICENSE file.
      4 
      5 /*---
      6 description: >
      7  void AwaitExpression is still evaluated
      8 info: |
      9  ModuleItem:
     10    StatementListItem[~Yield, +Await, ~Return]
     11 
     12  ...
     13 
     14  UnaryExpression[Yield, Await]
     15    void UnaryExpression[?Yield, ?Await]
     16    [+Await]AwaitExpression[?Yield]
     17 
     18  AwaitExpression[Yield]:
     19    await UnaryExpression[?Yield, +Await]
     20 esid: prod-AwaitExpression
     21 flags: [module, async]
     22 features: [top-level-await]
     23 ---*/
     24 
     25 var got = 0;
     26 var x = {
     27  get y() {
     28    got += 1;
     29  }
     30 };
     31 
     32 void await x.y;
     33 
     34 assert.sameValue(got, 1);
     35 
     36 $DONE();