summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/AsyncIterator/prototype/every/return-true-if-all-match.js
blob: 01d0f75d5879f5bd31c86ddab15ec94db69426a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// |reftest| skip-if(!this.hasOwnProperty('AsyncIterator'))

async function* gen() {
  yield 1;
  yield 3;
  yield 5;
}
const fn = x => x % 2 == 1;

gen().every(fn).then(result => assertEq(result, true));

async function* empty() {}
empty().every(x => x).then(result => assertEq(result, true));

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