non-iterable-input-with-thenable-sync-mapped-callback-err.js (571B)
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. 4 5 /*--- 6 esid: sec-array.fromasync 7 description: Non iterable result promise rejects if sync map function callback throws. 8 includes: [asyncHelpers.js] 9 flags: [async] 10 features: [Array.fromAsync] 11 ---*/ 12 13 asyncTest(async function () { 14 const input = { 15 length: 1, 16 0: 0, 17 }; 18 const outputPromise = Array.fromAsync(input, v => { 19 throw new Test262Error; 20 }); 21 assert.throwsAsync(Test262Error, () => outputPromise); 22 });