diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-iterator-throws.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-iterator-throws.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-iterator-throws.js b/js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-iterator-throws.js new file mode 100644 index 0000000000..148c3d9dfe --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-iterator-throws.js @@ -0,0 +1,17 @@ +// |reftest| async +// Copyright (C) 2022 Igalia, S.L. All rights reserved. +// This code is governed by the BSD license found in the LICENSE file. + +/*--- +esid: sec-array.fromasync +description: > + Array.fromAsync rejects if getting the @@iterator property throws +includes: [asyncHelpers.js] +flags: [async] +features: [Array.fromAsync] +---*/ + +asyncTest(async function () { + await assert.throwsAsync(Test262Error, + () => Array.fromAsync({ get [Symbol.iterator]() { throw new Test262Error() } })); +}); |