summaryrefslogtreecommitdiffstats
path: root/js/src/tests/non262/AsyncIterator/prototype/find/async-writes.js
blob: 6d1707e2feafb38f35aef26be95f4bfa2f3066b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// |reftest| skip-if(!this.hasOwnProperty('AsyncIterator'))

let x = {a: () => true};

async function* gen() {
  yield x.a();
  yield x.a();
}

gen().find(() => {}).then(
  () => assertEq(true, false, 'expected error'),
  err => assertEq(err instanceof Error, true),
);

x.a = () => {
  throw Error();
};

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