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] Use class inheritance for getters and setters #18314

Merged
merged 1 commit into from
Aug 28, 2019

Commits on Aug 27, 2019

  1. [BUGFIX beta] Use class inheritance for getters and setters

    Currently, `get` and `set` will bypass class inheritance and lookup
    descriptors for CPs. If they exist, they call them directly. This
    results in bugs where plain, undecorated getters and setters cannot
    override CPs on parent classes.
    
    This fix converts us to using class inheritance, looking up descriptors
    recursively on the class to find the actual property that is meant to be
    accessed for this instance. In the `get` case, this is simple removing
    the bypass altogether. For the `set` case, this would result in
    behavioral differences:
    
    * An additional `get` triggered just before setting, since `set` gets
    the previous value in order to know if it should notify.
    * An additional property change notification for CPs, since they must
    notify themselves (when set using a native setter, for instance).
    
    Instead, this PR looks up the descriptor and checks to see if it's a
    `CPSETTER` function, and triggers it directly if so.
    Chris Garrett committed Aug 27, 2019
    Configuration menu
    Copy the full SHA
    f046bbe View commit details
    Browse the repository at this point in the history