Backed out 3 changesets (bug 1892041) for causing failures on async-module-does-not...
[gecko.git] / js / src / tests / test262 / built-ins / Array / fromAsync / sync-iterable-iteration-err.js
blob91b110e4ed07b8508d541231f85e5d42b82c615a
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: Sync iterable result promise rejects if iteration of input fails.
8 includes: [asyncHelpers.js]
9 flags: [async]
10 features: [Array.fromAsync]
11 ---*/
13 asyncTest(async function () {
14   function *generateInput () {
15     throw new Test262Error;
16   }
17   const input = generateInput();
18   const outputPromise = Array.fromAsync(input);
19   await assert.throwsAsync(Test262Error, () => outputPromise);
20 });