<commit_before>(function(Monarch) {
  Monarch.Util.Deferrable = new JS.Module('Monarch.Util.Deferrable', {
    initialize: function() {
      this._deferrableNodes = {};
      this._deferrableData = {};
      this._deferrableTriggerred = {};
    },

    onSuccess: function(callback, context) {
      return this.on('success', callback, context);
    },

    onInvalid: function(callback, context) {
      return this.on('invalid', callback, context);
    },

    onError: function(callback, context) {
      return this.on('error', callback, context);
    },

    triggerSuccess: function() {
      this.trigger('success', arguments);
    },

    triggerInvalid: function() {
      this.trigger('invalid', arguments);
    },

    triggerError: function() {
      this.trigger('error', arguments);
    },

    on: function(eventName, callback, context) {
      if (this._deferrableTriggerred[eventName]) {
        callback.apply(context, this._deferrableData[eventName])
      } else {
        var node = this._deferrableNodes[eventName];
        if (!node) node = this._deferrableNodes[eventName] = new Monarch.Util.Node();
        node.subscribe(callback, context);
      }
      return this;
    },

    trigger: function(eventName, data) {
      this._deferrableTriggerred[eventName] = true;
      this._deferrableData[eventName] = data;
      var node = this._deferrableNodes[eventName];
      if (node) node.publishArgs(data);
    }
  });

  Monarch.Util.Deferrable.success = Monarch.Util.Deferrable.onSuccess;
})(Monarch);<commit_msg>Alias success to onSuccess the right way.<commit_after>(function(Monarch) {
  Monarch.Util.Deferrable = new JS.Module('Monarch.Util.Deferrable', {
    initialize: function() {
      this._deferrableNodes = {};
      this._deferrableData = {};
      this._deferrableTriggerred = {};
    },

    onSuccess: function(callback, context) {
      return this.on('success', callback, context);
    },

    onInvalid: function(callback, context) {
      return this.on('invalid', callback, context);
    },

    onError: function(callback, context) {
      return this.on('error', callback, context);
    },

    triggerSuccess: function() {
      this.trigger('success', arguments);
    },

    triggerInvalid: function() {
      this.trigger('invalid', arguments);
    },

    triggerError: function() {
      this.trigger('error', arguments);
    },

    on: function(eventName, callback, context) {
      if (this._deferrableTriggerred[eventName]) {
        callback.apply(context, this._deferrableData[eventName])
      } else {
        var node = this._deferrableNodes[eventName];
        if (!node) node = this._deferrableNodes[eventName] = new Monarch.Util.Node();
        node.subscribe(callback, context);
      }
      return this;
    },

    trigger: function(eventName, data) {
      this._deferrableTriggerred[eventName] = true;
      this._deferrableData[eventName] = data;
      var node = this._deferrableNodes[eventName];
      if (node) node.publishArgs(data);
    }
  });

  Monarch.Util.Deferrable.alias({success: 'onSuccess'});
})(Monarch);
{'fraction_non_alphanumeric': 0.13953488372093023, 'fraction_numerical': 0.0, 'mean_word_length': 3.1514745308310994, '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': '5706871', 'n_tokens_mistral': 932, 'n_tokens_neox': 904, 'n_words': 165}