<commit_before>Strophe.addConnectionPlugin('iexdomain', {
    init: function(conn) {
        // replace Strophe.Request._newXHR with new IE CrossDomain version
        var nativeXHR = new XMLHttpRequest();
        if (window.XDomainRequest && ! ("withCredentials" in nativeXHR)) {
            Strophe.Request.prototype._newXHR = function() {
                var xhr = new XDomainRequest();
                xhr.setRequestHeader = function () {} ;
                xhr.readyState = 0;

                xhr.onreadystatechange = this.func.prependArg(this);
                xhr.onerror = function() {
                    xhr.readyState = 4;
                    xhr.status = 500;
                    xhr.onreadystatechange(xhr.responseText);
                };
                xhr.ontimeout = function() {
                    xhr.readyState = 4;
                    xhr.status = 0;
                    xhr.onreadystatechange(xhr.responseText);
                };
                xhr.onload = function() {
                    xhr.readyState = 4;
                    xhr.status = 200;
                    var _response = xhr.responseText;
                    var _xml = new ActiveXObject('Microsoft.XMLDOM');
                    _xml.async = 'false';
                    _xml.loadXML(_response);
                    xhr.responseXML = _xml;
                    xhr.onreadystatechange(_response);
                };
                return xhr;
            };
        } else {
            console.info("Browser doesnt support XDomainRequest." + "  Falling back to native XHR implementation.");
        }
    }<commit_msg>Replace non-standard prependArg with bind<commit_after>Strophe.addConnectionPlugin('iexdomain', {
    init: function(conn) {
        // replace Strophe.Request._newXHR with new IE CrossDomain version
        var nativeXHR = new XMLHttpRequest();
        if (window.XDomainRequest && ! ("withCredentials" in nativeXHR)) {
            Strophe.Request.prototype._newXHR = function() {
                var xhr = new XDomainRequest();
                xhr.setRequestHeader = function () {} ;
                xhr.readyState = 0;

                xhr.onreadystatechange = this.func.bind(undefined, this);
                xhr.onerror = function() {
                    xhr.readyState = 4;
                    xhr.status = 500;
                    xhr.onreadystatechange(xhr.responseText);
                };
                xhr.ontimeout = function() {
                    xhr.readyState = 4;
                    xhr.status = 0;
                    xhr.onreadystatechange(xhr.responseText);
                };
                xhr.onload = function() {
                    xhr.readyState = 4;
                    xhr.status = 200;
                    var _response = xhr.responseText;
                    var _xml = new ActiveXObject('Microsoft.XMLDOM');
                    _xml.async = 'false';
                    _xml.loadXML(_response);
                    xhr.responseXML = _xml;
                    xhr.onreadystatechange(_response);
                };
                return xhr;
            };
        } else {
            console.info("Browser doesnt support XDomainRequest." + "  Falling back to native XHR implementation.");
        }
    }
{'fraction_non_alphanumeric': 0.09474007997539219, 'fraction_numerical': 0.00676714856967087, 'mean_word_length': 1.324517512508935, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '5965732', 'n_tokens_mistral': 895, 'n_tokens_neox': 805, 'n_words': 159}