]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[bugfix] Fixing isFunction when Function is undefined (#5174)
authorAlex Werner <Alex-Werner@users.noreply.github.com>
Thu, 23 Apr 2020 19:59:02 +0000 (21:59 +0200)
committerGitHub <noreply@github.com>
Thu, 23 Apr 2020 19:59:02 +0000 (22:59 +0300)
Preventing any `Uncaught ReferenceError: Function is not defined` error as per suggested in PR thread.

src/lib/utils/is-function.js

index 12304b1bd63b0e585a68cce90438f9c39d769c2b..31196c002a4bddd5bec2528696641be1e61d6840 100644 (file)
@@ -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]';
 }