Repository navigation
fix(65598): preserve this binding in wrapped private member calls - #65602
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the fix preserving receiver binding in wrapped private-member calls.
No open issues 🎉
What changed in this PR
Fixes #65598 by preserving this binding when the compiler lowers calls through wrapped private members for targets below ES2022.
Changes:
- Recognizes private callees through parentheses and type-only wrappers, preserving receivers for calls, optional calls, and tagged templates.
- Extends conformance tests for private methods, static methods, fields, and accessors, including a comma-expression case that remains unbound.
- Updates JavaScript, type, and symbol baselines.
| File | Description |
|---|---|
tsc/testdata/tests/cases/conformance/classes/members/privateNames/privateNameStaticMethodCallExpression.ts |
Adds wrapped static private method cases. |
tsc/testdata/tests/cases/conformance/classes/members/privateNames/privateNameMethodCallExpression.ts |
Adds instance method wrappers, tags, and comma-expression coverage. |
tsc/testdata/tests/cases/conformance/classes/members/privateNames/privateNameFieldCallExpression.ts |
Adds wrapped private function-field cases. |
tsc/testdata/tests/cases/conformance/classes/members/privateNames/privateNameAccessorsCallExpression.ts |
Adds wrapped private accessor cases. |
tsc/testdata/baselines/reference/conformance/privateNameStaticMethodCallExpression.types |
Records types for new static method cases. |
tsc/testdata/baselines/reference/conformance/privateNameStaticMethodCallExpression.symbols |
Updates static method symbol expectations. |
tsc/testdata/baselines/reference/conformance/privateNameStaticMethodCallExpression.js |
Records receiver-preserving static method emit. |
tsc/testdata/baselines/reference/conformance/privateNameMethodCallExpression.types |
Records types for new instance method cases. |
tsc/testdata/baselines/reference/conformance/privateNameMethodCallExpression.symbols |
Updates instance method symbol expectations. |
tsc/testdata/baselines/reference/conformance/privateNameMethodCallExpression.js |
Records bound calls and tags, retaining unbound comma calls. |
tsc/testdata/baselines/reference/conformance/privateNameFieldCallExpression.types |
Records types for new field cases. |
tsc/testdata/baselines/reference/conformance/privateNameFieldCallExpression.symbols |
Updates private field symbol expectations. |
tsc/testdata/baselines/reference/conformance/privateNameFieldCallExpression.js |
Records receiver-preserving private field emit. |
tsc/testdata/baselines/reference/conformance/privateNameAccessorsCallExpression.types |
Records types for new accessor cases. |
tsc/testdata/baselines/reference/conformance/privateNameAccessorsCallExpression.symbols |
Updates private accessor symbol expectations. |
tsc/testdata/baselines/reference/conformance/privateNameAccessorsCallExpression.js |
Records receiver-preserving private accessor emit. |
tsc/internal/transformers/estransforms/classfields.go |
Unwraps private callees for binding and restores outer expressions after lowering. |
Review effort: Balanced
Wesley Wigham (weswigham)
approved these changes
Nov 20, 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.
Fixes #65598