summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/AsyncIterator/prototype/reduce/left-associative.js
blob: 91147a1fba0069140b69a160e936a4134830133b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// |reftest| skip-if(!this.hasOwnProperty('AsyncIterator')) 

async function* gen() {
  yield 1;
  yield 2;
  yield 3;
}

gen().reduce((x, y) => `(${x}+${y})`, 0)
  .then(result => assertEq(result, '(((0+1)+2)+3)'));
gen().reduce((x, y) => `(${x}+${y})`)
  .then(result => assertEq(result, '((1+2)+3)'));

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