emberjs/ember.js — pull request #9854 by bendemboski (2014-12-10 00:54:30+00:00)
Title: [BUGFIX beta] Deprecate passing non-Array enumerables to addObjects() and pushObjects()

This is the result of the discussion in #9843

pushObjects(), unshiftObjects(), removeObjects() and setObjects() were all documented to accept enumerables, but would only function properly when passed a native array, so update their documentation.

pushObjects() has an assert ensuring that the argument is an enumerable or array-like object. It should really be asserting that the argument is a native array, but changing it would cause calls passing in an enumerable that now produce incorrect behavior to start throwing an exception, so instead just add a deprecation warning in case the argument is not a native array.

addObjects() was documented to accept enumerables, and would behave correctly when passed an enumerable, which is not consistent with its sister methods and therefore not desired behavior. So update the documentation and add a deprecation warning in case the argument is not a native array.

Also take the opportunity to implement some addObjects() unit tests.