<commit_before>export default function ClickSelectionMixin(Base) {
  return class ClickSelection extends Base {

    constructor(props) {
      super(props);
      this.click = this.click.bind(this);
    }

    click(event) {
      // REVIEW: is this the best way to reliably map the event target to a
      // child?
      const parent = event.target.parentNode;
      const targetIndex = [...parent.children].indexOf(event.target);
      if (targetIndex >= 0) {
        this.setState((prevState, props) => {
          return {
            selectedIndex: targetIndex
          }
        });
      }
    }

    listProps() {
      const base = super.listProps ? super.listProps() : {};
      return Object.assign({}, base, {
        onClick: this.click
      });
    }
    
  }
}
<commit_msg>Drop use of spread operator (not supported in Safari/Edge yet).<commit_after>export default function ClickSelectionMixin(Base) {
  return class ClickSelection extends Base {

    constructor(props) {
      super(props);
      this.click = this.click.bind(this);
    }

    click(event) {
      // REVIEW: is this the best way to reliably map the event target to a
      // child?
      const parent = event.target.parentNode;
      const targetIndex = [].indexOf.call(parent.children, event.target);
      if (targetIndex >= 0) {
        this.setState((prevState, props) => {
          return {
            selectedIndex: targetIndex
          }
        });
      }
    }

    listProps() {
      const base = super.listProps ? super.listProps() : {};
      return Object.assign({}, base, {
        onClick: this.click
      });
    }
    
  }
}

{'fraction_non_alphanumeric': 0.11782661782661782, 'fraction_numerical': 0.001221001221001221, 'mean_word_length': 2.086629001883239, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5196203', 'n_tokens_mistral': 464, 'n_tokens_neox': 459, 'n_words': 116}