-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Description
Using Ember 1.8.1 on Chrome 39.0.2171.71, execute the following command in the browser console:
[].pushObjects(Ember.ArrayProxy.create({ content: [ 1, 2, 3 ] }))
Since an ArrayProxy is an enumerable, the return value should be [ 1, 2, 3 ], but instead it is an array containing a single object, which is the ArrayProxy. You can verify this by running:
[].pushObjects(Ember.ArrayProxy.create({ content: [ 1, 2, 3 ] }))[0].constructor
and seeing that the result is Ember.ArrayProxy.
I believe the bug is caused by https://github.com/emberjs/ember.js/blob/v1.8.1/packages/ember-metal/lib/enumerable_utils.js#L134. objects is the array proxy, and [].concat() is a native method that doesn't understand ArrayProxies, and just sees it as a single object to be pushed onto the array.
Metadata
Metadata
Assignees
Labels
No labels