<commit_before>'use strict';

var _ = require('lodash');

var initWatchVal = function() { };

exports.Scope = function() {
  this.$$watchers = [];
};

exports.Scope.prototype.$watch = function(watchFn, listenerFn) {
  var watcher = {
    watchFn: watchFn,
    listenerFn: listenerFn || function() { },
    last: initWatchVal,
  };
  this.$$watchers.push(watcher);
};

exports.Scope.prototype.$digestOnce = function() {
  var self = this;
  var dirty;
  _.forEach(this.$$watchers, function(watcher) {
    var newValue = watcher.watchFn(self);
    var oldValue = watcher.last;
    if (newValue !== oldValue) {
      watcher.last = newValue;
      watcher.listenerFn(
          newValue,
          (oldValue === initWatchVal ? newValue : oldValue),
          self);
      dirty = true;
    }
  });
  return dirty;
};

exports.Scope.prototype.$digest = function() {
  var dirty;
  do {
    dirty = this.$$digestOnce();
  } while (dirty);
};<commit_msg>Fixed small bug with scope to call  instead of 13260digestOnce<commit_after>'use strict';

var _ = require('lodash');

var initWatchVal = function() { };

exports.Scope = function() {
  this.$$watchers = [];
};

exports.Scope.prototype.$watch = function(watchFn, listenerFn) {
  var watcher = {
    watchFn: watchFn,
    listenerFn: listenerFn || function() { },
    last: initWatchVal,
  };
  this.$$watchers.push(watcher);
};

exports.Scope.prototype.$digestOnce = function() {
  var self = this;
  var dirty;
  _.forEach(this.$$watchers, function(watcher) {
    var newValue = watcher.watchFn(self);
    var oldValue = watcher.last;
    if (newValue !== oldValue) {
      watcher.last = newValue;
      watcher.listenerFn(
          newValue,
          (oldValue === initWatchVal ? newValue : oldValue),
          self);
      dirty = true;
    }
  });
  return dirty;
};

exports.Scope.prototype.$digest = function() {
  var dirty;
  do {
    dirty = this.$digestOnce();
  } while (dirty);
};
{'fraction_non_alphanumeric': 0.15174897119341563, 'fraction_numerical': 0.00257201646090535, 'mean_word_length': 3.0775681341719077, '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': '4386476', 'n_tokens_mistral': 638, 'n_tokens_neox': 617, 'n_words': 135}