diff options
Diffstat (limited to 'js/src/tests/non262/AsyncIterator/prototype/reduce/no-initial-value-set-accumulator-to-first-value.js')
-rw-r--r-- | js/src/tests/non262/AsyncIterator/prototype/reduce/no-initial-value-set-accumulator-to-first-value.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/tests/non262/AsyncIterator/prototype/reduce/no-initial-value-set-accumulator-to-first-value.js b/js/src/tests/non262/AsyncIterator/prototype/reduce/no-initial-value-set-accumulator-to-first-value.js new file mode 100644 index 0000000000..0e480dbe4a --- /dev/null +++ b/js/src/tests/non262/AsyncIterator/prototype/reduce/no-initial-value-set-accumulator-to-first-value.js @@ -0,0 +1,13 @@ +// |reftest| skip-if(!this.hasOwnProperty('AsyncIterator')) + +const reducer = (acc, _) => acc; +async function* gen() { + yield 1; + yield 2; + yield 3; +} + +gen().reduce(reducer).then(result => assertEq(result, 1)); + +if (typeof reportCompare === 'function') + reportCompare(0, 0); |