tor-browser

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

try-await-expr-new-expr.js (1747B)


      1 // |reftest| module
      2 // This file was procedurally generated from the following sources:
      3 // - src/top-level-await/await-expr-new-expr.case
      4 // - src/top-level-await/syntax/try.template
      5 /*---
      6 description: AwaitExpression new MemberExpression (Valid syntax for top level await in try-catch-finally blocks.)
      7 esid: prod-AwaitExpression
      8 features: [top-level-await]
      9 flags: [generated, module]
     10 info: |
     11    ModuleItem:
     12      StatementListItem[~Yield, +Await, ~Return]
     13 
     14    ...
     15 
     16    TryStatement[Yield, Await, Return]:
     17      try Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return]
     18      try Block[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return]
     19      try Block[?Yield, ?Await, ?Return] Catch[?Yield, ?Await, ?Return] Finally[?Yield, ?Await, ?Return]
     20 
     21    ...
     22 
     23    UnaryExpression[Yield, Await]
     24      [+Await]AwaitExpression[?Yield]
     25 
     26    AwaitExpression[Yield]:
     27      await UnaryExpression[?Yield, +Await]
     28 
     29    ...
     30 
     31 
     32    LeftHandSideExpression[Yield, Await]:
     33      NewExpression[?Yield, ?Await]
     34      CallExpression[?Yield, ?Await]
     35 
     36    NewExpression[Yield, Await]:
     37      MemberExpression[?Yield, ?Await]
     38      new NewExpression[?Yield, ?Await]
     39 
     40    MemberExpression[Yield, Await]:
     41      ...
     42      new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]
     43 
     44 ---*/
     45 
     46 
     47 try {
     48  await new Promise(function(res, rej) { res(1); });
     49 } catch(e) {
     50  await new Promise(function(res, rej) { res(1); });
     51 }
     52 
     53 try {
     54  await new Promise(function(res, rej) { res(1); });
     55 } finally {
     56  await new Promise(function(res, rej) { res(1); });
     57 }
     58 
     59 try {
     60  await new Promise(function(res, rej) { res(1); });
     61 } catch(e) {
     62  await new Promise(function(res, rej) { res(1); });
     63 } finally {
     64  await new Promise(function(res, rej) { res(1); });
     65 }
     66 
     67 reportCompare(0, 0);