| 1 |
// Copyright 2016 Microsoft, Inc. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
author: Brian Terlson <[email protected]> |
| 6 |
esid: pending |
| 7 |
description: > |
| 8 |
Await can await any thenable. If the thenable's then is not callable, |
| 9 |
await evaluates to the thenable |
| 10 |
flags: [async] |
| 11 |
---*/ |
| 12 |
|
| 13 |
async function foo() { |
| 14 |
var thenable = { then: 42 }; |
| 15 |
var res = await thenable; |
| 16 |
assert.sameValue(res, thenable); |
| 17 |
} |
| 18 |
|
| 19 |
foo().then($DONE, $DONE); |
| 20 |
|