summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/language/statements/async-function/evaluation-body-that-returns-after-await.js
blob: f89a24d7a826c329f438d01d9e7eea3122ff6654 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// |reftest| async
// Copyright 2016 Microsoft, Inc. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
author: Brian Terlson <brian.terlson@microsoft.com>
esid: pending
description: >
  The return value of the async function resolves the promise
flags: [async]
---*/

async function foo() {
  await Promise.resolve();
  return 42;
}

foo().then(function (v) {
  assert.sameValue(v, 42);
  $DONE();
}, $DONE);