fix(partial-app): support super method call#17662
Merged
JLHwung merged 2 commits intobabel:mainfrom Jan 23, 2026
Merged
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60625 |
|
commit: |
liuxingbaoyu
approved these changes
Jan 22, 2026
JLHwung
commented
Jan 22, 2026
| return _this$compare.call(_this, _argPlaceholder, _argPlaceholder2); | ||
| var _this$compare; | ||
| this.compare = (_this$compare = this.compare, function compare(_argPlaceholder, _argPlaceholder2) { | ||
| return _this$compare.call(this, _argPlaceholder, _argPlaceholder2); |
Contributor
Author
There was a problem hiding this comment.
This change is not correct, although this is static in _this$compare = this.compare, the result is no longer a bound method because the function wrapper compare has its own this binding. We should still memoise this to ensure that the method is bound.
The test suite does not actually test the this binding, so the test still passes.
541ef74 to
4622ec4
Compare
liuxingbaoyu
approved these changes
Jan 23, 2026
nicolo-ribaudo
approved these changes
Jan 23, 2026
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.
This PR improves the member expression handling such that it supports the super method. Previously we generated invalid lone
supernode.The handling logic here is copied from the decorators transform. As a bonus the new logic will reuse thethisexpression when possible. Hence there are a few output changes.Also left a todo comment in the plugin since partial applications nested within
NewExpressionandOptionalCallExpressionare not yet supported.