sproutcore/sproutcore — pull request #983 by sbteng (2013-05-27 03:34:16+00:00)
Title: Fix for issue #980

Copy from issue 980:
See this function:
enumerableContentDidChange: function (start, length, deltas) {
// If the start & length are provided, we can also indicate if the firstObject
// or lastObject properties changed, thus making them independently observable.
if (!SC.none(start)) {
if (start === 0) this.notifyPropertyChange('firstObject');
//THIS IS A WRONG STATEMENT
if (!SC.none(length) && start + length === this.get('length')-1 ) this.notifyPropertyChange('lastObject');
}
this.notifyPropertyChange('[]');
},

The statement is wrong. Should be:
if (!SC.none(length) && start + length >= this.get('length')-1 )

Consider a simple case:
There is an array [1,2,3], remove the last number 3
start is 2, length is 1, this.get('length') is 2 after the operation. 2+1 === 2-1 ?