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] Mutating an arranged ArrayProxy is not allowed #16157

Merged
merged 1 commit into from
Jan 21, 2018

Conversation

mmun
Copy link
Member

@mmun mmun commented Jan 20, 2018

Arranged array proxies should be treated as an immutable view of the underlying data. If you want to mutate the items, you must mutate the underlying content array.

Non-arranged array proxies (i.e. that don't override the arrangedContent descriptor) will continue to proxy any array mutations to the underlying content array.


The existing ArrayProxy code already had this behaviour for a few methods (insertAt, replace, etc). This PR normalizes the behaviour across all the MutableArray methods. I made sure to test this PR against ember-data master. After scanning Ember Observer, I am confident that this behaviour was not being relied on by addons.

I also removed the private nextObject method that should have been removed as part of an earlier PR.

@mmun mmun requested a review from rwjblue January 20, 2018 23:52
@mmun mmun force-pushed the array-proxy-no-mutate-arranged branch from a73f809 to 8aefdfa Compare January 21, 2018 00:37
@mmun mmun force-pushed the array-proxy-no-mutate-arranged branch from 8aefdfa to bfc5a68 Compare January 21, 2018 00:58
@mmun mmun merged commit f2c2fb9 into master Jan 21, 2018
@mmun mmun deleted the array-proxy-no-mutate-arranged branch January 21, 2018 01:28
backspace added a commit to travis-ci/travis-web that referenced this pull request May 8, 2018
The mutation of the LimitedArray was triggering this error:
emberjs/ember.js#16157
backspace added a commit to travis-ci/travis-web that referenced this pull request May 9, 2018
The way LimitedArray was being used is now forbidden in Ember 3:
emberjs/ember.js#16157
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.

2 participants