summaryrefslogtreecommitdiffstats
path: root/js/src/tests/test262/built-ins/Array/fromAsync/non-iterable-input-with-thenable-sync-mapped-callback-err.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/fromAsync/non-iterable-input-with-thenable-sync-mapped-callback-err.js')
-rw-r--r--js/src/tests/test262/built-ins/Array/fromAsync/non-iterable-input-with-thenable-sync-mapped-callback-err.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/fromAsync/non-iterable-input-with-thenable-sync-mapped-callback-err.js b/js/src/tests/test262/built-ins/Array/fromAsync/non-iterable-input-with-thenable-sync-mapped-callback-err.js
new file mode 100644
index 0000000000..c1543fe582
--- /dev/null
+++ b/js/src/tests/test262/built-ins/Array/fromAsync/non-iterable-input-with-thenable-sync-mapped-callback-err.js
@@ -0,0 +1,22 @@
+// |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: Non iterable result promise rejects if sync map function callback throws.
+includes: [asyncHelpers.js]
+flags: [async]
+features: [Array.fromAsync]
+---*/
+
+asyncTest(async function () {
+ const input = {
+ length: 1,
+ 0: 0,
+ };
+ const outputPromise = Array.fromAsync(input, v => {
+ throw new Test262Error;
+ });
+ assert.throwsAsync(Test262Error, () => outputPromise);
+});