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 beta] Ensure record array length is reset during willDestroy. #4560

Merged
merged 1 commit into from
Sep 29, 2016

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Sep 29, 2016

In Ember 2.10+ objects that are in the middle of being destroyed no longer notify property changes on itself (or other destroying objects) to avoid wasted work. This means that set(this, 'content', undefined) isn't enough to ensure that Enumerable mixin will notifyPropertyChange(this, 'length') (since its observers are not fired).

This change also sets length during cleanup so it properly resets to 0.

This fixes the build against latest ember#canary.

In Ember 2.10+ objects that are in the middle of being destroyed no
longer notify property changes on itself (or other destroying objects)
to avoid wasted work.  This means that `set(this, 'content',
undefined)` isn't enough to ensure that `Enumerable` mixin will
`notifyPropertyChange(this, 'length')` (since its observers are not
fired).

This change also sets `length` during cleanup so it properly resets to
`0`.
@igorT
Copy link
Member

igorT commented Sep 29, 2016

Seems scary, but hard to observe the problem, not sure how that test came about

@rwjblue rwjblue deleted the ensure-record-array-lenght-is-reset branch September 29, 2016 19:01
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.

4 participants