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

Runtime error when static property initializer of a decorated class references the class #51570

Open
zamb3zi opened this issue Nov 17, 2022 · 0 comments
Assignees
Labels
Needs Investigation This issue needs a team member to investigate its status.

Comments

@zamb3zi
Copy link

zamb3zi commented Nov 17, 2022

Bug Report

🔎 Search Terms

static initialization decorator runtime

🕗 Version & Regression Information

  • Occurring in 4.8.4
  • This changed between versions 4.5.5 and 4.6.4 when static properties started transpiling as static initialization blocks

⏯ Playground Link

Playground link with relevant code

💻 Code

const dec: ClassDecorator = cls => cls;
@dec class A { static x = new A }

🙁 Actual behavior

No compilation error as expected, but this generates a runtime error of "undefined is not a constructor".

🙂 Expected behavior

Either a compilation error, or no runtime error.

@zamb3zi zamb3zi changed the title Runtime error when static property of a decorated class references the class Runtime error when static property initializer of a decorated class references the class Nov 17, 2022
@RyanCavanaugh RyanCavanaugh added the Needs Investigation This issue needs a team member to investigate its status. label Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Investigation This issue needs a team member to investigate its status.
Projects
None yet
Development

No branches or pull requests

3 participants