<commit_before>export class AttributeNode {
  constructor(node, index, boundAttrs, boundEvents, context) {
    this.node = node;
    this.index = index;
    this.boundAttrs = boundAttrs;
    this.boundEvents = boundEvents;
    this.context = context;

    this.addListeners();
  }

  addListeners() {
    this.boundEvents.forEach((eventHandler, eventName) => {
      this.node.addEventListener(eventName, function(event) {
        eval(eventHandler);
      }.bind(this.context));
    });
  }

  cleanUp() {
    this.boundAttrs.forEach(attr =>
      attr.value = attr.value.replace('---!{', '').replace('}!---', ''));
  }

  update(newNode) {
    this.boundAttrs.forEach(attr => {
      const newAttr = newNode.boundAttrs.get(attr.name);
      attr.value !== newAttr.value ? attr.value = newAttr.value : null;<commit_msg>fix(removed eval): Removed eval for Function constructor<commit_after>export class AttributeNode {
  constructor(node, index, boundAttrs, boundEvents, context) {
    this.node = node;
    this.index = index;
    this.boundAttrs = boundAttrs;
    this.boundEvents = boundEvents;
    this.context = context;

    this.addListeners();
  }

  addListeners() {
    this.boundEvents.forEach((eventHandler, eventName) => {
      const handler = new Function(eventHandler);
      this.node.addEventListener(eventName, handler.bind(this.context))
    });
  }

  cleanUp() {
    this.boundAttrs.forEach(attr =>
      attr.value = attr.value.replace('---!{', '').replace('}!---', ''));
  }

  update(newNode) {
    this.boundAttrs.forEach(attr => {
      const newAttr = newNode.boundAttrs.get(attr.name);
      attr.value !== newAttr.value ? attr.value = newAttr.value : null;
{'fraction_non_alphanumeric': 0.15480427046263345, 'fraction_numerical': 0.0, 'mean_word_length': 3.292620865139949, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4858974', 'n_tokens_mistral': 532, 'n_tokens_neox': 526, 'n_words': 89}