Last active
August 29, 2015 13:57
-
-
Save usmonster/9349332 to your computer and use it in GitHub Desktop.
bug in aight's shim for Element.prototype.textContent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=Edge"> | |
<script type="text/javascript"> | |
function test() { | |
try { | |
var e = document.createElement('div'); | |
e.innerHTML = ' '; | |
var n = e.childNodes[0]; | |
n.ownerDocument; | |
e.textContent = ''; | |
n.ownerDocument; | |
alert('worked!'); | |
} catch (ex) { | |
alert('NOPENOPENOPE'); | |
} | |
} | |
</script> | |
<script type="text/javascript">test();</script> | |
<!--[if lt IE 9]> | |
<script type="text/javascript" src="http://rawgithub.com/shawnbot/aight/master/js/element-properties.js"></script> | |
<script type="text/javascript">test();</script> | |
<![endif]--> | |
</head> | |
<body> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Traced it to element-properties.js. (issue).
Can be seen manifesting in the wild (e.g., when shim is used with popular libraries such as jQuery >= 1.9, etc.).