From: Alex Werner Date: Thu, 23 Apr 2020 19:59:02 +0000 (+0200) Subject: [bugfix] Fixing isFunction when Function is undefined (#5174) X-Git-Tag: 2.25.0~85 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d37cf3708174d9ce08cbf8932e2e0fa5887abda3;p=thirdparty%2Fmoment.git [bugfix] Fixing isFunction when Function is undefined (#5174) Preventing any `Uncaught ReferenceError: Function is not defined` error as per suggested in PR thread. --- diff --git a/src/lib/utils/is-function.js b/src/lib/utils/is-function.js index 12304b1bd..31196c002 100644 --- a/src/lib/utils/is-function.js +++ b/src/lib/utils/is-function.js @@ -1,3 +1,3 @@ export default function isFunction(input) { - return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; + return typeof Function !== 'undefined' && input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; }