Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/async-arrow-function/try-reject-finally-reject.js

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