2 // Copyright (C) 2023 Igalia, S.L. All rights reserved.
3 // This code is governed by the BSD license found in the LICENSE file.
6 esid: sec-array.fromasync
7 description: Rejects on array-like object whose length cannot be gotten
9 3.k.iii. Let _len_ be ? LengthOfArrayLike(_arrayLike_).
10 features: [Array.fromAsync]
12 includes: [asyncHelpers.js]
15 asyncTest(async function () {
16 await assert.throwsAsync(Test262Error, () => Array.fromAsync({
18 throw new Test262Error('accessing length property fails');
20 }), "Promise should be rejected if array-like length getter throws");
22 await assert.throwsAsync(TypeError, () => Array.fromAsync({
25 }), "Promise should be rejected if array-like length can't be converted to a number");