<commit_before>import Freezer from 'freezer-js';

export default class Component extends Freezer {

  constructor(application, parent, name, initialState = {}) {
    initialState.application = application;
    initialState.parent = parent;
    initialState.name = name;

    super(initialState);

    this.on('update', (currentState) => {
      this.application.stateUpdatedHandler(currentState);
    });
  }

  activate() {
  }

  deactivate() {
  }

  get path() {
    let parentComponentPath = this.parent !== null ? this.parent.path : [];
    return parentComponentPath.concat(this.name);
  }

  get state() {
    return this.get();
  }

  get application() {
    return this.state.application;
  }

  get parent() {
    return this.state.parent;
  }

  get name() {
    return this.state.name;
  }

};
<commit_msg>Component: clone initialState before using<commit_after>import Freezer from 'freezer-js';

export default class Component extends Freezer {

  constructor(application, parent, name, initialState = {}) {
    let clonedInitialState = Object.assign({}, initialState, {
      application: application,
      parent: parent,
      name: name
    });
    super(clonedInitialState);

    this.on('update', (currentState) => {
      this.application.stateUpdatedHandler(currentState);
    });
  }

  activate() {
  }

  deactivate() {
  }

  get path() {
    let parentComponentPath = this.parent !== null ? this.parent.path : [];
    return parentComponentPath.concat(this.name);
  }

  get state() {
    return this.get();
  }

  get application() {
    return this.state.application;
  }

  get parent() {
    return this.state.parent;
  }

  get name() {
    return this.state.name;
  }

};

{'fraction_non_alphanumeric': 0.13130128956623682, 'fraction_numerical': 0.0, 'mean_word_length': 3.083732057416268, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '3778564', 'n_tokens_mistral': 524, 'n_tokens_neox': 505, 'n_words': 110}