Skip to content

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

Merged
rbuckton merged 1 commit into
masterfrom
fix44113
May 20, 2021
Merged

Move class name capture for private state after declaration evaluates#44186
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 @dragomirtitian, @mkubilayk

@typescript-bot typescript-bot assigned rbuckton and unassigned rbuckton May 20, 2021
@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels May 20, 2021
@rbuckton
rbuckton merged commit 4ce12f9 into master May 20, 2021
@rbuckton

Copy link
Copy Markdown
Contributor Author

@typescript-bot cherry-pick this to release-4.3

@typescript-bot

typescript-bot commented May 20, 2021

Copy link
Copy Markdown
Contributor

Heya @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 @rbuckton, I've opened #44188 for you.

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
@DanielRosenwasser
DanielRosenwasser deleted the fix44113 branch May 20, 2021 22:00
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 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