-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
canReflect.assignDeep doesn't deep copy DefineMap #150
Comments
The fix that I made seems correct, but it breaks |
Which can-define and can-map tests are failing with your change? |
I tried to find a solution by overwriting |
Can you describe what you did a bit more in depth. Ideally with snippets of the source you are taking about. |
In my comment above I'm talking about this snippets in var defaultValues = this._setupDefaults(obj);
var data = assign(canReflect.assignDeep({}, defaultValues), obj); Fixing this issue will break |
I fixed the two broken tests for Here is the changes:
It remains the broken test in |
The last changes/release in |
I'm not totally sure this isn't expected behavior. I always expected Though, jQuery and lodash do the same thing as what you expected: https://codepen.io/justinbmeyer/pen/YdZYvj The odd thing here is types. You expect it to be a plain object, but I'm not sure that necessarily makes sense. Why shouldn't |
I should have been more clear. I don't expect
|
@roemhildtg Yeah to be clear, when I'm not sure we have a We should check if lodash has a clone and how it works. Also, lets say this encountered DOM ... could we teach it to use |
|
Code Sample:
https://codepen.io/anon/pen/rQOBPx?editors=0011
Objects nested inside a define map won't be deep copied, instead they will still reference the original object.
I may be wrong on this, but I would expect a to be a plain object with all of the properties from b copied over, not referenced.
The text was updated successfully, but these errors were encountered: