Debian Codegraph @

js/src/tests/test262/language/statements/async-function/try-reject-finally-reject.js

raw
1 // |reftest| async
2 // Copyright 2017 Caitlin Potter. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 author: Caitlin Potter <[email protected]>
7 esid: pending
8 description: >
9 Implementations must defer rejecting an async function's Promise until after
10 all finally blocks have been evaluated.
11 flags: [async]
12 ---*/
13
14 async function f() {
15 try {
16 await new Promise(function(resolve, reject) {
17 reject("early-reject");
18 });
19 } finally {
20 await new Promise(function(resolve, reject) {
21 reject("override");
22 });
23 }
24 }
25
26 f().then($DONE, function(value) {
27 assert.sameValue(value, "override", "Awaited rejection in finally block");
28 }).then($DONE, $DONE);