<commit_before>'use strict';

import oo from './oo'

/*
  An iterator for arrays.
  @class
  @param {Array} arr
 */
function ArrayIterator(arr) {
  this.arr = arr;
  this.pos = -1;
}

ArrayIterator.Prototype = function() {

  this._isArrayIterator = true;

  /**
    @returns {Boolean} true if there is another child node left.
   */
  this.hasNext = function() {
    return this.pos < this.arr.length - 1;
  };

  /**
    Increments the iterator providing the next child node.

    @returns {HTMLElement} The next child node.
   */
  this.next = function() {
    this.pos += 1;
    var next = this.arr[this.pos];
    return next;
  };

  /**
    Decrements the iterator.
   */
  this.back = function() {
    if (this.pos >= 0) {
      this.pos -= 1;
    }
    return this;
  };

};

oo.initClass(ArrayIterator);

export default ArrayIterator;<commit_msg>ES6 ArrayIterator.<commit_after>/*
  An iterator for arrays.

  @class
  @param {Array} arr
 */
class ArrayIterator {

  constructor(arr) {
    this.arr = arr
    this.pos = -1
  }

  get _isArrayIterator() {
    return true
  }

  /**
    @returns {Boolean} true if there is another child node left.
   */
  hasNext() {
    return this.pos < this.arr.length - 1
  }

  /**
    Increments the iterator providing the next child node.

    @returns {HTMLElement} The next child node.
   */
  next() {
    this.pos += 1
    var next = this.arr[this.pos]
    return next
  }

  /**
    Decrements the iterator.
   */
  back() {
    if (this.pos >= 0) {
      this.pos -= 1
    }
    return this
  }
}

export default ArrayIterator;
{'fraction_non_alphanumeric': 0.13211125158027812, 'fraction_numerical': 0.00695322376738306, 'mean_word_length': 2.257201646090535, 'pattern_counts': {'":': 0, '<': 5, '<?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': '6235995', 'n_tokens_mistral': 547, 'n_tokens_neox': 530, 'n_words': 150}