Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from May 20, 2021

Conversation

rbuckton
Copy link
Member

@rbuckton rbuckton commented May 20, 2021

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
10 checks passed
@rbuckton
Copy link
Member Author

rbuckton commented May 20, 2021

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

@typescript-bot
Copy link
Collaborator

typescript-bot commented May 20, 2021

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
Collaborator

typescript-bot commented May 20, 2021

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
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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