Debian Codegraph @

js/src/tests/test262/language/statements/async-function/evaluation-body-that-throws.js

raw
1 // |reftest| async
2 // Copyright 2016 Microsoft, Inc. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
4
5 /*---
6 author: Brian Terlson <[email protected]>
7 esid: pending
8 description: >
9 Errors thrown from the async function body reject the returned promise
10 flags: [async]
11 ---*/
12
13 async function foo() {
14 throw 1;
15 }
16
17 foo().then(function () {
18 $DONE("Should not be called");
19 }, function (e) {
20 assert.sameValue(e, 1);
21 $DONE();
22 });
23