diff options
Diffstat (limited to 'js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-asynciterator-throws.js')
-rw-r--r-- | js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-asynciterator-throws.js | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-asynciterator-throws.js b/js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-asynciterator-throws.js new file mode 100644 index 0000000000..22c78f236a --- /dev/null +++ b/js/src/tests/test262/built-ins/Array/fromAsync/asyncitems-asynciterator-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 @@asyncIterator property throws +includes: [asyncHelpers.js] +flags: [async] +features: [Array.fromAsync] +---*/ + +asyncTest(async function () { + await assert.throwsAsync(Test262Error, + () => Array.fromAsync({ get [Symbol.asyncIterator]() { throw new Test262Error() } })); +}); |