Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 7ca3278

Browse files
committedJun 9, 2018
isFunction: Fix incorrect behaviour for async functions
1 parent 72ec2ab commit 7ca3278

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed
 

‎common.blocks/functions/functions.vanilla.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ provide(/** @exports */{
1414
* @returns {Boolean}
1515
*/
1616
isFunction : function(obj) {
17-
return toStr.call(obj) === '[object Function]';
17+
// In some browsers, typeof returns "function" for HTML <object> elements
18+
// (i.e., `typeof document.createElement( "object" ) === "function"`).
19+
// We don't want to classify *any* DOM node as a function.
20+
return typeof obj === 'function' && typeof obj.nodeType !== 'number';
1821
},
1922

2023
/**

0 commit comments

Comments
 (0)
Please sign in to comment.