wesaynih / infrastructure

© 2016 The Knights Who Say NIH — Do NOT fork this repository without permission.
http://frameless.io/
Other
0 stars 1 forks source link

Explain why `node instanceof Constructor` pattern can't be used for DOM node tests #37

Closed Yolijn closed 8 years ago

Yolijn commented 8 years ago

DOM.js has so many functions like isElement et cetera, and they all use node.nodeType == Node.ELEMENT_TYPE instead of node instanceof Element, without once explaining why this is necessary (constructors from other windows and browser compatibility, apparently).