summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/AsyncIterator/prototype/find/return-undefined-if-none-match.js
blob: b7dc84703614d380d2aad82e4f451f2f916f2488 (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 == 0;

gen().find(fn).then(result => assertEq(result, undefined));

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

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