emberjs/ember.js — pull request #4971 by hjdivad (2014-06-01 18:38:10+00:00)
Title: [BUGFIX beta] gate reduceComputed item property changes.

When multiple items in an upstream CP have a property that a reduce cp's
`DependentArrayObserver` is watching, and that property depends on some
shared other property, it is possible for `flushChanges` to be called
before all the items have had their caches cleared.

This commit ensures that the item property changes are flushed on the
*last* item's property change, rather than the *first* item's property
change. This used to be handled via the run loop, but now that reduce CPs
are synchronous (to keep them more in line with regular CPs) we need to
gate these changes with a semaphore.

Fix #4967.