Repository navigation
Keep declared methods of generic class instances after a computed-key write - #1215
Merged
Merged
Conversation
… write When a write with a computed string key can replace any method, calls of every method name read the receiver's property bag without checking for the key, and the bag falls back to the class's prototype data. Generic class instantiations, mixin classes and their subclasses have no prototype data, so their methods read as undefined and calls threw "x.status is not a function". Reads on these classes now check for an own property and otherwise use the declared method. Fixes #963 Co-authored-by: Quim T. <[email protected]>
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…write observedPrototypeMethod skipped classPrototypeData for function-local classes, which also marks such a class as needing prototype data, so its instances got no prototype behind their property bag. A function-local class value's prototype holds only methods the program replaced there, so reads of a marked method name on its instances now check for the property, own or inherited, and otherwise use the declared method, as for generic class instances. The prototype data is built again, so a method replaced on the class's prototype stays visible.
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #963