Debian Codegraph @

tests/auto/qml/ecmascripttests/test262/test/language/expressions/async-arrow-function/try-throw-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 throw "early-throw";
16 } finally {
17 await new Promise(function(resolve, reject) {
18 reject("override");
19 });
20 }
21 };
22
23 f().then($DONE, function(value) {
24 assert.sameValue(value, "override", "Awaited rejection in finally block");
25 }).then($DONE, $DONE);