Skip to content

Commit 18a0845

Browse files
committed
fix Common.isElement, closes #501, closes #507, closes #459, closes #468, closes #517
1 parent 9eae36f commit 18a0845

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/core/Common.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,11 @@ module.exports = Common;
177177
* @return {boolean} True if the object is a HTMLElement, otherwise false
178178
*/
179179
Common.isElement = function(obj) {
180-
return obj instanceof HTMLElement;
180+
if (typeof HTMLElement !== 'undefined') {
181+
return obj instanceof HTMLElement;
182+
}
183+
184+
return !!(obj.nodeType && obj.nodeName);
181185
};
182186

183187
/**

0 commit comments

Comments
 (0)