diff options
Diffstat (limited to 'js/src/tests/non262/AsyncIterator/prototype/some/async-writes.js')
-rw-r--r-- | js/src/tests/non262/AsyncIterator/prototype/some/async-writes.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/js/src/tests/non262/AsyncIterator/prototype/some/async-writes.js b/js/src/tests/non262/AsyncIterator/prototype/some/async-writes.js new file mode 100644 index 0000000000..384bf2e115 --- /dev/null +++ b/js/src/tests/non262/AsyncIterator/prototype/some/async-writes.js @@ -0,0 +1,20 @@ +// |reftest| skip-if(!this.hasOwnProperty('AsyncIterator')) + +let x = {a: () => true}; + +async function* gen() { + yield x.a(); + yield x.a(); +} + +gen().some(() => {}).then( + () => assertEq(true, false, 'expected error'), + err => assertEq(err instanceof Error, true), +); + +x.a = () => { + throw Error(); +}; + +if (typeof reportCompare === 'function') + reportCompare(0, 0); |