Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Array / fromAsync / returned-promise-resolves-to-array.js
blobb6ccf790af3d842e2bd945b311646177e57288b5
1 // |reftest| async
2 // Copyright (C) 2023 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
5 /*---
6 esid: sec-array.fromasync
7 description: >
8   Array.fromAsync returns a Promise that resolves to an Array in the normal case
9 info: |
10   1. Let _C_ be the *this* value.
11   ...
12   3.e. If IsConstructor(_C_) is *true*, then
13     i. Let _A_ be ? Construct(_C_).
14 features: [Array.fromAsync]
15 flags: [async]
16 includes: [asyncHelpers.js]
17 ---*/
19 asyncTest(async function () {
20   const promise = Array.fromAsync([0, 1, 2]);
21   const array = await promise;
22   assert(Array.isArray(array), "Array.fromAsync returns a Promise that resolves to an Array");
23 });