Skip to content

fix(65598): preserve this binding in wrapped private member calls - #65602

Merged
Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
a-tarasyuk:fix/65598
Nov 20, 2026
Merged

Wesley Wigham (weswigham) merged 1 commit into
microsoft:mainfrom
a-tarasyuk:fix/65598

Conversation

@a-tarasyuk

Copy link
Copy Markdown
Contributor

Fixes #65598

Copilot AI balanced review requested due to automatic review settings November 20, 2026 14:10
@typescript-automation typescript-automation Bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Nov 20, 2026
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 20, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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

@typescript-automation typescript-automation Bot added For Milestone Bug PRs that fix a bug with a specific milestone and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 20, 2026
@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 20, 2026
@weswigham
Wesley Wigham (weswigham) added this pull request to the merge queue Nov 20, 2026
Merged via the queue into microsoft:main with commit d0f15bd Nov 20, 2026
34 checks passed
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

For Milestone Bug PRs that fix a bug with a specific milestone

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Calls through #private members lose this below ES2022 when the callee is parenthesized or has !, as or satisfies

3 participants