Test that Node is a function before using instanceof on it

This commit is contained in:
evanc
2014-02-25 17:55:31 -08:00
parent ba78edbed8
commit 26179d2b79
+1 -1
View File
@@ -23,7 +23,7 @@
*/
function isNode(object) {
return !!(object && (
typeof Node !== 'undefined' ? object instanceof Node :
typeof Node === 'function' ? object instanceof Node :
typeof object === 'object' &&
typeof object.nodeType === 'number' &&
typeof object.nodeName === 'string'