-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
a property designated as a mergedProperties will mutate the prototype if set during create #11714
Comments
I'm running into this, trying to used an As a side note, this could probably use the new Edit: Looks like master is already using embers |
When `mergedProperties` are passed into an object at `.create()` time, the objects prototype is inadvertently modified, which is then reflected on all instances of the object. Simply passing in a new object during `assign()` resolves this problem (per krisselden). Also added a test for this use case, where `objA` results in 3 when the proto is modified. Fixes #11714 (cherry picked from commit fa87517)
When `mergedProperties` are passed into an object at `.create()` time, the objects prototype is inadvertently modified, which is then reflected on all instances of the object. Simply passing in a new object during `assign()` resolves this problem (per krisselden). Also added a test for this use case, where `objA` results in 3 when the proto is modified. Fixes #11714 (cherry picked from commit fa87517)
ember.js/packages/ember-runtime/lib/system/core_object.js
Line 146 in fb49fa0
this should be value = merge({}, originalValue, value);
The text was updated successfully, but these errors were encountered: