diff options
Diffstat (limited to '')
-rw-r--r-- | js/src/tests/non262/AsyncIterator/prototype/reduce/reducer-not-callable-throws.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/src/tests/non262/AsyncIterator/prototype/reduce/reducer-not-callable-throws.js b/js/src/tests/non262/AsyncIterator/prototype/reduce/reducer-not-callable-throws.js new file mode 100644 index 0000000000..c7fb2005d8 --- /dev/null +++ b/js/src/tests/non262/AsyncIterator/prototype/reduce/reducer-not-callable-throws.js @@ -0,0 +1,24 @@ +// |reftest| skip-if(!this.hasOwnProperty('AsyncIterator')) + +async function *gen() {} + +function check(fn) { + gen().reduce(fn).then(() => { + throw new Error('every should have thrown'); + }, + err => { + assertEq(err instanceof TypeError, true); + }); +} + +check(); +check(undefined); +check(null); +check(0); +check(false); +check(''); +check(Symbol('')); +check({}); + +if (typeof reportCompare === 'function') + reportCompare(0, 0); |