<commit_before>(function() {
    try {
        // from <NAME> @ http://eligrey.com/blog/post/textcontent-in-ie8
        if (Object.defineProperty && Object.getOwnPropertyDescriptor &&
            Object.getOwnPropertyDescriptor(Element.prototype, "textContent") &&
            !Object.getOwnPropertyDescriptor(Element.prototype, "textContent").get) {
            var innerText = Object.getOwnPropertyDescriptor(Element.prototype, "innerText");
            Object.defineProperty(Element.prototype, "textContent", {
                // It won't work if you just drop in innerText.get
                // and innerText.set or the whole descriptor.
                get: function() {
                    return innerText.get.call(this);
                },
                set: function(x) {
                    return innerText.set.call(this, x);
                }
            });
        }
    } catch (e) {
        // bad Firefox
    }
})();
<commit_msg>Slightly more correct shim for Node.textContent<commit_after>(function() {
    try {
        // inspired by <NAME>rey'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) {
            var nodeValue = Object.getOwnPropertyDescriptor(Text.prototype, "nodeValue");
            Object.defineProperty(Text.prototype, "textContent", {
                // It won't work if you just drop in nodeValue.get
                // and nodeValue.set or the whole descriptor.
                get: function() {
                    return nodeValue.get.call(this);
                },
                set: function(x) {
                    return nodeValue.set.call(this,x);
                }
            });
            var innerText = Object.getOwnPropertyDescriptor(Element.prototype, "innerText");
            Object.defineProperty(Element.prototype, "textContent", {
                get: function() {
                    // It won't work if you just drop in innerText.get
                    // or the whole descriptor.
                    return innerText.get.call(this);
                },
                set: function(x) {
                    //return innerText.set.call(this,x); // nope! you do weird things!
                    var c;
                    while(!!(c=this.firstChild)) { this.removeChild(c); }
                    if (x!==null) {
                        c=document.createTextNode(x);
                        this.appendChild(c);
                    }
                    c=null;
                    return x;
                }
            });
        }
    } catch (e) {
        // bad Firefox
    }
})();

{'fraction_non_alphanumeric': 0.11419857675364284, 'fraction_numerical': 0.0057607590647238225, 'mean_word_length': 1.5317324185248713, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5414947', 'n_tokens_mistral': 771, 'n_tokens_neox': 730, 'n_words': 149}