Skip to content
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

[BUGFIX release] Fix mergedProperties at create time modifying proto #13031

Merged
merged 1 commit into from
Mar 2, 2016
Merged

[BUGFIX release] Fix mergedProperties at create time modifying proto #13031

merged 1 commit into from
Mar 2, 2016

Conversation

Panman82
Copy link
Contributor

@Panman82 Panman82 commented Mar 1, 2016

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

@stefanpenner
Copy link
Member

cc @krisselden

@rwjblue
Copy link
Member

rwjblue commented Mar 1, 2016

LGTM, chatted with @krisselden and he was 👍 also.

I think this needs to go back into release (due to LTS), @Panman8201 can you use [BUGFIX release]?

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
@Panman82 Panman82 changed the title [BUGFIX beta] Fix mergedProperties at create time modifying proto [BUGFIX release] Fix mergedProperties at create time modifying proto Mar 2, 2016
@Panman82
Copy link
Contributor Author

Panman82 commented Mar 2, 2016

@rwjblue Done

@rwjblue
Copy link
Member

rwjblue commented Mar 2, 2016

Thank you!

rwjblue added a commit that referenced this pull request Mar 2, 2016
…-proto

[BUGFIX release] Fix mergedProperties at create time modifying proto
@rwjblue rwjblue merged commit c7ddfb4 into emberjs:master Mar 2, 2016
@Panman82 Panman82 deleted the fix-create-mergedProperties-proto branch March 2, 2016 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

a property designated as a mergedProperties will mutate the prototype if set during create
3 participants