summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/AsyncIterator/prototype/reduce/no-initial-value-set-accumulator-to-first-value.js
blob: 0e480dbe4a542a1b80f77779d0fb5dfb08b457af (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).then(result => assertEq(result, 1));

if (typeof reportCompare === 'function')
  reportCompare(0, 0);