<commit_before>
(function () {
  var stack = [];
  
  window.ready = function (fn) {
    return function () {
      stack.push(fn);
    };
  };
  
  window.onload = function () {
    for (var i = 0, l = stack.length; i < l; i++) {
      stack[i]();
    }
    
    window.mocha.run();
  };
})();<commit_msg>[feature] support async blow.ready<commit_after>
(function () {
  var ready = [];

  window.blow = {
    readyBind: function (fn) {
      return function () {
        ready.push(fn);
      };
    },

    ready: function (fn) {
      ready.push(fn);
    }
  };

  window.onload = function () {
    (function loop(i) {
      // the ready stack has been executed
      if (i < 0) {
        window.mocha.run();
        return;
      }

      var fn = ready[i];

      // no callback applyed, treat as sync
      if (fn.length === 0) {
        return loop(i - 1);
      }

      // callback applyed, treat as async
      fn(function () {
        loop(i - 1);
      });
    })(ready.length - 1);
  };
})();
{'fraction_non_alphanumeric': 0.17296222664015903, 'fraction_numerical': 0.005964214711729622, 'mean_word_length': 1.7142857142857142, 'pattern_counts': {'":': 0, '<': 5, '<?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': '160813', 'n_tokens_mistral': 355, 'n_tokens_neox': 337, 'n_words': 81}