Skip to content

Move class name capture for private state after declaration evaluates - #44186

Merged
Ron Buckton (rbuckton) merged 1 commit into
masterfrom
fix44113
May 20, 2021
Merged

Ron Buckton (rbuckton) merged 1 commit into
masterfrom
fix44113

Conversation

@rbuckton

Copy link
Copy Markdown
Contributor

Our private field transform inadvertently attempted to capture the class declaration during its evaluation when we encountered a computed property name, resulting in a ReferenceError at runtime due to the binding not being initialized.

Fixes #44113

/cc Titian Cernicova-Dragomir (@dragomirtitian), Kubilay Kahveci (@mkubilayk)

@rbuckton
Ron Buckton (rbuckton) merged commit 4ce12f9 into master May 20, 2021
@rbuckton

Copy link
Copy Markdown
Contributor Author

TypeScript Bot (@typescript-bot) cherry-pick this to release-4.3

@typescript-bot

TypeScript Bot (typescript-bot) commented May 20, 2021 •

Copy link
Copy Markdown
Contributor

Heya Ron Buckton (@rbuckton), I've started to run the task to cherry-pick this into release-4.3 on this PR at acdaf36. You can monitor the build here.

@typescript-bot

Copy link
Copy Markdown
Contributor

Hey Ron Buckton (@rbuckton), I've opened #44188 for you.

TypeScript Bot (typescript-bot) pushed a commit to typescript-bot/TypeScript that referenced this pull request May 20, 2021
Component commits:
acdaf36 Move class name capture for private state until after declaration evaluates
Daniel Rosenwasser (DanielRosenwasser) pushed a commit that referenced this pull request May 20, 2021
Component commits:
acdaf36 Move class name capture for private state until after declaration evaluates

Co-authored-by: Ron Buckton <rbuckton@microsoft.com>
@microsoft Microsoft (microsoft) locked as resolved and limited conversation to collaborators Oct 21, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

class initialization fails when #private static field is present together with computed method name

4 participants