<commit_before>'use strict';

function autoproxy(decorator) {
  return function(target) {
    var decoratedTarget = decorator(target);
    if (decoratedTarget !== target) {
      proxyProperties(decoratedTarget, target);
      proxyProperties(decoratedTarget.prototype, target.prototype);
    }
    return decoratedTarget;
  };
}

function proxyProperties(target, source) {
  var propertyNames = Object.getOwnPropertyNames(source);
  for (var ii = 0; ii < propertyNames.length; ii++) {
    var name = propertyNames[ii];
    if (name in target) {
      continue;
    }

    var descriptor = Object.getOwnPropertyDescriptor(source, name);
    Object.defineProperty(target, name, {
      configurable: descriptor.configurable,
      enumerable: descriptor.enumerable,
      get: function() {
        return source[name];
      },
      set: function(value) {
        source[name] = value;
      },
    });
  }
}

module.exports = autoproxy;
<commit_msg>Fix variable binding<commit_after>'use strict';

function autoproxy(decorator) {
  return function(target) {
    var decoratedTarget = decorator(target);
    if (decoratedTarget !== target) {
      proxyProperties(decoratedTarget, target);
      proxyProperties(decoratedTarget.prototype, target.prototype);
    }
    return decoratedTarget;
  };
}

function proxyProperties(target, source) {
  var propertyNames = Object.getOwnPropertyNames(source);
  propertyNames.forEach(function(name) {
    if (name in target) {
      return;
    }

    var descriptor = Object.getOwnPropertyDescriptor(source, name);
    Object.defineProperty(target, name, {
      configurable: descriptor.configurable,
      enumerable: descriptor.enumerable,
      get: function() {
        return source[name];
      },
      set: function(value) {
        source[name] = value;
      },
    });
  });
}

module.exports = autoproxy;

{'fraction_non_alphanumeric': 0.11344086021505376, 'fraction_numerical': 0.0005376344086021505, 'mean_word_length': 3.378823529411765, 'pattern_counts': {'":': 0, '<': 4, '<?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': '3980784', 'n_tokens_mistral': 527, 'n_tokens_neox': 521, 'n_words': 111}