We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 72ec2ab commit 7ca3278Copy full SHA for 7ca3278
common.blocks/functions/functions.vanilla.js
@@ -14,7 +14,10 @@ provide(/** @exports */{
14
* @returns {Boolean}
15
*/
16
isFunction : function(obj) {
17
- return toStr.call(obj) === '[object Function]';
+ // 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';
21
},
22
23
/**
0 commit comments