diff options
Diffstat (limited to 'js/src/tests/non262/Iterator/prototype/find/fn-not-callable-throws.js')
-rw-r--r-- | js/src/tests/non262/Iterator/prototype/find/fn-not-callable-throws.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/js/src/tests/non262/Iterator/prototype/find/fn-not-callable-throws.js b/js/src/tests/non262/Iterator/prototype/find/fn-not-callable-throws.js new file mode 100644 index 0000000000..33d18b49cc --- /dev/null +++ b/js/src/tests/non262/Iterator/prototype/find/fn-not-callable-throws.js @@ -0,0 +1,15 @@ +// |reftest| skip-if(!this.hasOwnProperty('Iterator')) -- Iterator is not enabled unconditionally + +const iter = [].values(); + +assertThrowsInstanceOf(() => iter.find(), TypeError); +assertThrowsInstanceOf(() => iter.find(undefined), TypeError); +assertThrowsInstanceOf(() => iter.find(null), TypeError); +assertThrowsInstanceOf(() => iter.find(0), TypeError); +assertThrowsInstanceOf(() => iter.find(false), TypeError); +assertThrowsInstanceOf(() => iter.find(''), TypeError); +assertThrowsInstanceOf(() => iter.find(Symbol('')), TypeError); +assertThrowsInstanceOf(() => iter.find({}), TypeError); + +if (typeof reportCompare === 'function') + reportCompare(0, 0); |