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] Setting ArrayProxy#content in willDestroy resets length. #16784

Merged
merged 1 commit into from Jun 28, 2018

Commits on Jun 28, 2018

  1. [BUGFIX] Setting ArrayProxy#content in willDestroy resets length.

    Prior to this change, `ArrayProxy.prototype.length` was marked as dirty
    (and therefore recomputed) when `content` was set due to
    `arrangedContent` being an alias of `content`, and `ArrayProxy`
    implementing `PROPERTY_DID_CHANGE` to trap `arrangedContent` changes.
    
    Unfortunately, `notifyPropertyChange` avoids notifying _some_ things
    when the object is destroying. This results in the preexisting
    `PROPERTY_DID_CHANGE` trap for `arrangedContent` is no longer called,
    and therefore `length` is never marked as dirty.
    
    This fixes the condition, by implementing a `content` trap in
    `PROPERTY_DID_CHANGE` that marks length as dirty. The next time that
    `length` is accessed it will do the normal work to recalculate.
    rwjblue committed Jun 28, 2018
    Copy the full SHA
    7189bf0 View commit details
    Browse the repository at this point in the history