tor-browser

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

await-expr-new-expr-reject.js (1031B)


      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  Evaluation of a rejected promise
      8 info: |
      9  ModuleItem:
     10    StatementListItem[~Yield, +Await, ~Return]
     11 
     12  ...
     13 
     14  UnaryExpression[Yield, Await]
     15    [+Await]AwaitExpression[?Yield]
     16 
     17  AwaitExpression[Yield]:
     18    await UnaryExpression[?Yield, +Await]
     19 
     20  ...
     21 
     22  LeftHandSideExpression[Yield, Await]:
     23    NewExpression[?Yield, ?Await]
     24    CallExpression[?Yield, ?Await]
     25 
     26  NewExpression[Yield, Await]:
     27    MemberExpression[?Yield, ?Await]
     28    new NewExpression[?Yield, ?Await]
     29 
     30  MemberExpression[Yield, Await]:
     31    ...
     32    new MemberExpression[?Yield, ?Await] Arguments[?Yield, ?Await]
     33 esid: prod-AwaitExpression
     34 flags: [module, async]
     35 features: [top-level-await]
     36 ---*/
     37 
     38 var obj = new Test262Error();
     39 
     40 try {
     41  await Promise.reject(obj);
     42 } catch (e) {
     43  assert.sameValue(e, obj);
     44  $DONE();
     45 }
     46 
     47 // Can't use assert.throws here as it relies in a nested function.