emberjs/ember.js — pull request #5014 by duereg (2014-06-13 00:42:38+00:00)
Title: [BUGFIX] Fix issue where bad params are passed to arrayWillChange on Col...

[BUGFIX] Fix issue where bad params are passed to arrayWillChange on CollectionView.

There is an sporadic issue that comes up where when you modifying the underlying array for a collection view, you can generate an error like so:

![screen shot 2014-06-12 at 2 17 30 pm](https://cloud.githubusercontent.com/assets/325737/3265502/3edbb538-f293-11e3-87a1-ad5080e5134b.png)

The issue is arrayWillChange takes a param, *removedCount*, but never checks if that value is greater than the current number of child views the parent view contains.

To test this, I added a console log to the arrayWillChange method, where I output the value of removedCount(the first number) and the length of the childViews array (the second number).

![screen shot 2014-06-12 at 5 38 58 pm](https://cloud.githubusercontent.com/assets/325737/3265511/73b810ee-f293-11e3-8d72-5eba487a1bce.png)

Notice the bottom line of this screen shot. The *removedCount* is 7, but the length of the child views is 0.