emberjs/ember.js — pull request #3470 by bantic (2013-09-24 22:30:50+00:00)
Title: Fixes #3332 - Array computed properties should update in the same run loop

When an array changes, array computed properties that are dependent on it will now reflect the correct value in the same run loop. Previously we would wait until the end of the run loop (via `Ember.run.once`) to flush the changes.

Note:
There is a performance consideration when flushing the changes. Specifically, if the length and offset of the dependent key array changes before the properties are modified, we want to avoid repeated runs of the [inner loop](https://github.com/hjdivad/ember.js/blob/d33e848cdbae0235a0e661119f50e5f3c525709c/packages/ember-runtime/lib/computed/reduce_computed.js#L212) of the `updateIndexes` method in `reduce_computed.js`. @mixonic @hjdivad and I mannually confirmed that the [early return](https://github.com/hjdivad/ember.js/blob/d33e848cdbae0235a0e661119f50e5f3c525709c/packages/ember-runtime/lib/computed/reduce_computed.js#L206) in `updateIndexes` is hit for RETAIN operations where the array index has not changed.