emberjs/ember.js — pull request #3627 by hjdivad (2013-10-21 23:59:49+00:00)
Title: [BUGFIX beta] reduceComputed handle out-of-range index.

f3aa4a2d0854395e1f8158a74d1810c290a75139 added support for `replace`s on
dependent arrays with out of range indexes, similar to what `[].splice`
supports. However, it had two errors that are corrected in this commit.

1. An off by one error when determining the normalized index for removal
2. It did not limit the removed count by the number of items that could possibly
be removed.

Change `normalizeIndex` to the more natural signature of `index, length,
count`. This has no effect on any public API.

Big thanks to @Cyril-sf for pairing on this fix.

Fix #3586 (again).

f3aa4a2d0854395e1f8158a74d1810c290a75139 fixed several bugs, but missed a couple
cases relevant to @gavinwahl's jsbin. That jsbin passes for me with this PR.