Arrow functions are not instanceof Function

But their `typeof` is `function`, so use this instead to
detect whether an argument is a function which can be
called.

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/qyx7en/
This commit is contained in:
Raymond Hill 2021-11-21 11:17:05 -05:00
parent 9b1f59c8b2
commit 374d4800e5
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -21,6 +21,7 @@
// https://www.reddit.com/r/uBlockOrigin/comments/ghjqph/
// https://github.com/NanoMeow/QuickReports/issues/3717
// https://www.reddit.com/r/uBlockOrigin/comments/qyx7en/
(function() {
'use strict';
@ -30,7 +31,7 @@
}.bind();
const apstag = {
fetchBids: function(a, b) {
if ( b instanceof Function ) {
if ( typeof b === 'function' ) {
b([]);
}
},