<commit_before>/*global Arenite:true*/
/*jshint evil:true*/
// Collection of utility functions to handle loading resources.
Arenite.Loader = function (arenite) {

  var _createCORSRequest = function (method, url) {
    var xhr = new XMLHttpRequest();
    xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
    xhr.setRequestHeader("Access-Control-Allow-Origin", window.location.origin);
    if (arenite.config.withCredentials){
    if ('withCredentials' in xhr) {
      xhr.open(method, url, true);
      xhr.withCredentials = true;
    } else if (typeof XDomainRequest !== 'undefined') {
      xhr = new XDomainRequest();
      xhr.open(method, url);  
    } else {
      xhr.open(method, url, true);
    }
    return xhr;
  };

  var _loadResource = function (url, callback, error) {
    var req = _createCORSRequest('GET', url);<commit_msg>improving loader for IE<commit_after>/*global Arenite:true*/
/*jshint evil:true*/
// Collection of utility functions to handle loading resources.
Arenite.Loader = function (arenite) {

  var _createCORSRequest = function (method, url) {
    var xhr = new XMLHttpRequest();
    xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
    xhr.setRequestHeader("Access-Control-Allow-Origin", window.location.origin);
    if (arenite.config.withCredentials){
      if ('withCredentials' in xhr) {
        xhr.open(method, url, true);
        xhr.withCredentials = true;
      } else if (typeof XDomainRequest !== 'undefined') {
        xhr = new XDomainRequest();
        xhr.open(method, url);  
      } else {
        xhr=null
      }
    } else {
      xhr.open(method, url, true);
    }
    return xhr;
  };

  var _loadResource = function (url, callback, error) {
    var req = _createCORSRequest('GET', url);
{'fraction_non_alphanumeric': 0.13250283125707815, 'fraction_numerical': 0.0, 'mean_word_length': 3.278450363196126, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '2519195', 'n_tokens_mistral': 554, 'n_tokens_neox': 554, 'n_words': 134}