localGhost Posted April 8, 2014 Share Posted April 8, 2014 It is very awkward to say this, but for me it looks like current implementation of this function is bugged. Probably no one uses it anyway or it would be long found The thing is that the code falls in a very trivial trap: it changes the array it is iterating over: for (var i = startIndex; i < endIndex; i++) { if (this.children[i].events) { this.children[i].events.onRemovedFromGroup.dispatch(this.children[i], this); } this.removeChild(this.children[i]); if (this.cursor === this.children[i]) { this.cursor = null; } }removeChild line will shift the indexes, if I'm not mistaken. Eventually the loop fails on accessing .events for non-existant (out of bounds) child. Also it seems reasonable to make second parameter optional, just removing every item starting with startIndex. Link to comment Share on other sites More sharing options...
rich Posted April 9, 2014 Share Posted April 9, 2014 Well spotted This is fixed in 2.0.3 (in the dev branch) and will go live this week. Link to comment Share on other sites More sharing options...
localGhost Posted April 9, 2014 Author Share Posted April 9, 2014 Ah ok, thanks Link to comment Share on other sites More sharing options...
Recommended Posts