diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/non262/AsyncIterator/prototype/reduce/accumulator-set-to-initial-value.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/src/tests/non262/AsyncIterator/prototype/reduce/accumulator-set-to-initial-value.js b/js/src/tests/non262/AsyncIterator/prototype/reduce/accumulator-set-to-initial-value.js new file mode 100644 index 0000000000..943094aabc --- /dev/null +++ b/js/src/tests/non262/AsyncIterator/prototype/reduce/accumulator-set-to-initial-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, 0).then(value => assertEq(value, 0)); + +if (typeof reportCompare === 'function') + reportCompare(0, 0); |