tor-browser

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

catch-parameter.js (1333B)


      1 // |reftest| module
      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  Valid syntax for top level await.
      8  AwaitExpression ImportCall
      9 info: |
     10  ModuleItem:
     11    StatementListItem[~Yield, +Await, ~Return]
     12 
     13  ...
     14 
     15  UnaryExpression[Yield, Await]
     16    [+Await]AwaitExpression[?Yield]
     17 
     18  AwaitExpression[Yield]:
     19    await UnaryExpression[?Yield, +Await]
     20 
     21  ...
     22 
     23  TryStatement[Yield, Await, Return]:
     24    try Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return]
     25    try Block[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return]
     26    try Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return]
     27 
     28  Catch[Yield, Await, Return]:
     29    catch(CatchParameter[?Yield, ?Await])Block[?Yield, ?Await, ?Return]
     30    catchBlock[?Yield, ?Await, ?Return]
     31 
     32  Finally[Yield, Await, Return]:
     33    finallyBlock[?Yield, ?Await, ?Return]
     34 
     35  CatchParameter[Yield, Await]:
     36    BindingIdentifier[?Yield, ?Await]
     37    BindingPattern[?Yield, ?Await]
     38 esid: prod-AwaitExpression
     39 flags: [module]
     40 features: [top-level-await, dynamic-import]
     41 ---*/
     42 
     43 try {} catch ({ x = await 42 }) {} // Initializer
     44 try {} catch ({ x: y = await 42 }) {} // BindingElement Initializer
     45 try {} catch ([ x = await 42 ]) {}
     46 
     47 reportCompare(0, 0);