diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/fromAsync/sync-iterable-with-thenable-sync-mapped-callback-err.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Array/fromAsync/sync-iterable-with-thenable-sync-mapped-callback-err.js | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/fromAsync/sync-iterable-with-thenable-sync-mapped-callback-err.js b/js/src/tests/test262/built-ins/Array/fromAsync/sync-iterable-with-thenable-sync-mapped-callback-err.js new file mode 100644 index 0000000000..d502ec0209 --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/fromAsync/sync-iterable-with-thenable-sync-mapped-callback-err.js @@ -0,0 +1,19 @@ +// |reftest| async +// Copyright (C) 2023 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.fromasync +description: Sync-iterable input with thenable result promise rejects if sync map function callback throws. +includes: [asyncHelpers.js] +flags: [async] +features: [Array.fromAsync] +---*/ + +asyncTest(async function () { + const input = [ Promise.resolve(0) ].values(); + const outputPromise = Array.fromAsync(input, v => { + throw new Test262Error; + }); + await assert.throwsAsync(Test262Error, () => outputPromise); +}); |