title: Maximum call stack size exceeded when split
body: <p>Trying to duplicate <a href="https://agar.io" rel="nofollow">Agar</a>'s splitting function but when I call it, the maximum call stack size is exceeded. (<a href="https://jsfiddle.net/khanfused/6t07o0qv/4/" rel="nofollow">JSFiddle</a>) [note: don't click the canvas because that will trigger the split function)</p>
  
  <p>This is the snippet that causes the overflow:</p>
  
  <pre><code>this.cells.push({
      coords: {
          x: this.cells[i].coords.x + 50,
          y: this.cells[i].coords.y
      },
      mass: this.mass,
      velocity: {
          x: this.cells[i].velocity.x,
          y: this.cells[i].velocity.y
      },
      hue: this.cells[i].hue
  });
  </code></pre>
  
  <p>It <em>only</em> happens when I push something into this.cells. Modifying this.cells in any other way or pushing into other arrays or anything else works fine. Note that pushing into this.cells outside of the for loop it's currently in works fine. (doesn't produce desired effect but doesn't cause an overflow like the current one does)</p>
  
  <p>Why does it cause an overflow and how would I prevent it and get the split function to work properly?</p>