async-iterable-input-iteration-err.js (618B)
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: > 8 Array.fromAsync promise rejects if iteration of input fails. 9 flags: [async] 10 features: [Array.fromAsync] 11 includes: [asyncHelpers.js] 12 ---*/ 13 14 asyncTest(async function () { 15 async function *generateInput () { 16 throw new Test262Error('This error should be propagated.'); 17 } 18 const input = generateInput(); 19 const outputPromise = Array.fromAsync(input); 20 await assert.throwsAsync(Test262Error, () => outputPromise); 21 });