Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Array / fromAsync / non-iterable-with-non-promise-thenable.js
blob89388e27900f9dfbbf5b990f1c374b1205194d44
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: Non iterable input with non-promise thenables works.
8 includes: [compareArray.js, asyncHelpers.js]
9 flags: [async]
10 features: [Array.fromAsync]
11 ---*/
13 asyncTest(async function () {
14   const expectedValue = {};
15   const expected = [ expectedValue ];
16   const inputThenable = {
17     then (resolve, reject) {
18       resolve(expectedValue);
19     },
20   };
21   const input = {
22     length: 1,
23     0: inputThenable,
24   };
25   const output = await Array.fromAsync(input);
26   assert.compareArray(output, expected);
27 });