summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/AsyncIterator/prototype/reduce/accumulator-set-to-initial-value.js
blob: 943094aabcf107fa85f4d6c423848ff857bb012f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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);