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
8 The output promise rejects if the asynchronous mapping function rejects.
10 3.j.ii.6. If _mapping_ is *true*, then
11 a. Let _mappedValue_ be Call(_mapfn_, _thisArg_, « _nextValue_, 𝔽(_k_) »).
13 c. Set _mappedValue_ to Await(_mappedValue_).
14 d. IfAbruptCloseAsyncIterator(_mappedValue_, _iteratorRecord_).
16 includes: [asyncHelpers.js]
17 features: [Array.fromAsync]
20 asyncTest(async () => {
21 await assert.throwsAsync(Test262Error, () => Array.fromAsync([1, 2, 3], async () => {
22 throw new Test262Error("mapfn throws");
23 }), "async mapfn rejecting should cause fromAsync to reject");