diff --git a/src/util/MongoBinary.js b/src/util/MongoBinary.js index 9099ae209..f7dccfd27 100644 --- a/src/util/MongoBinary.js +++ b/src/util/MongoBinary.js @@ -51,7 +51,7 @@ export default class MongoBinary { let debug; if (opts.debug) { - if (typeof opts.debug === 'function' && opts.debug.apply) { + if (typeof opts.debug === 'function' && opts.debug.apply && opts.debug.call) { debug = opts.debug; } else { debug = console.log.bind(null); diff --git a/src/util/MongoBinaryDownload.js b/src/util/MongoBinaryDownload.js index abd3a810c..3b4d1f607 100644 --- a/src/util/MongoBinaryDownload.js +++ b/src/util/MongoBinaryDownload.js @@ -58,7 +58,7 @@ export default class MongoBinaryDownload { }; if (debug) { - if (typeof debug === 'function' && debug.apply) { + if (typeof debug === 'function' && debug.apply && debug.call) { this.debug = debug; } else { this.debug = console.log.bind(null); diff --git a/src/util/MongoInstance.js b/src/util/MongoInstance.js index 2981264b5..f86a270b1 100644 --- a/src/util/MongoInstance.js +++ b/src/util/MongoInstance.js @@ -54,7 +54,11 @@ export default class MongodbInstance { } if (this.opts.instance && this.opts.instance.debug) { - if (typeof this.opts.instance.debug === 'function' && this.opts.instance.debug.apply) { + if ( + typeof this.opts.instance.debug === 'function' && + this.opts.instance.debug.apply && + this.opts.instance.debug.call + ) { this.debug = this.opts.instance.debug; } else { this.debug = console.log.bind(null);