Skip to content

Fix class alias reference in static initializer for legacy class decorators #54046

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

Merged
merged 1 commit into from
Apr 28, 2023

Conversation

rbuckton
Copy link
Member

@rbuckton rbuckton commented Apr 27, 2023

This fixes an issue related to the class alias reference we emit for legacy decorators. Prior to this fix, static initializers would run before the class alias was initialized when the target is ES2022 or greater since the static fields would be preserved and initialized inline in the class, as opposed to after the class which would be the case for ES2021 and lower targets.

Fixes #52004
Fixes #44908

@typescript-bot typescript-bot added Author: Team For Milestone Bug PRs that fix a bug with a specific milestone labels Apr 27, 2023
@rbuckton rbuckton merged commit 611a912 into main Apr 28, 2023
@rbuckton rbuckton deleted the fix-52004 branch April 28, 2023 19:45
@markwhitfeld
Copy link

Fantastic!! Thank you for the PR to fix this. I tried to work on the PR, but the code is quite a challenge to understand all of the meta concepts.

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
4 participants