1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-03 09:39:38 +02:00

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([]);
}
},