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
(function() { | |
// inspired by Eli Grey's shim @ http://eligrey.com/blog/post/textcontent-in-ie8 | |
// heavily modified to better match the spec: | |
// http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/core.html#Node3-textContent | |
if (Object.defineProperty && Object.getOwnPropertyDescriptor && | |
Object.getOwnPropertyDescriptor(Element.prototype, 'textContent') && | |
!Object.getOwnPropertyDescriptor(Element.prototype, 'textContent').get) { | |
// NOTE: Neither of these "drop-in" patterns would work: | |
// Object.defineProperty(..., ..., descriptor); // nope! |