Skip to content

Arrays should respect the "deep" argument to Ember.copy() #588

Closed
adamjmurray opened this Issue Mar 13, 2012 · 2 comments

3 participants

@adamjmurray

See http://jsfiddle.net/e4nZE/

In NativeArray you have implemented copy() with a slice(). Perhaps it could be enhanced something like this?

copy: function(deep) {
  if(deep) {
    return this.map(function(item){ return Ember.copy(item, true); });
  } else {
    return this.slice();
  }
}
@wagenet
Ember.js member
wagenet commented Mar 14, 2012

That might work. You should also make sure to test deep copying with elements that do not implement Copyable.

@tomdale tomdale added a commit that closed this issue Nov 20, 2012
@tomdale tomdale NativeArray should support deep copies
This closes #588
ff265c0
@tomdale tomdale closed this in ff265c0 Nov 20, 2012
@adamjmurray

Confirmed fixed in Ember 1 pre4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.