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

Support undecorated static accessor in anonymous classes #16485

Merged

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented May 9, 2024

Q                       A
Fixed Issues? Fixes #16473
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

Ensures that the class is named when Babel transforms an undecorated static accessor. The named evaluation is still preserved because Babel generates specific setFunctionName calls for those will-be-transformed classes.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Decorators labels May 9, 2024
@JLHwung JLHwung marked this pull request as draft May 9, 2024 20:38
@JLHwung JLHwung force-pushed the support-anonymous-class-static-accessor branch from dd0139f to 7ff0a31 Compare May 9, 2024 20:50
@babel-bot
Copy link
Collaborator

babel-bot commented May 9, 2024

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/56888

@JLHwung JLHwung force-pushed the support-anonymous-class-static-accessor branch from 7ff0a31 to c55226a Compare May 9, 2024 20:56
@JLHwung JLHwung marked this pull request as ready for review May 9, 2024 20:56
@JLHwung JLHwung force-pushed the support-anonymous-class-static-accessor branch from c55226a to ab03576 Compare May 10, 2024 03:09
@@ -15,3 +15,19 @@ class Foo {
Foo.#B = v;
}
}
Foo = class _Class {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The named evaluation is still preserved because Babel generates specific setFunctionName calls for those will-be-transformed classes.

It doesn't seem to be the case here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in f45d9b3.

@nicolo-ribaudo
Copy link
Member

CI passed, I'm not sure about why it's still marked as yellow.

@nicolo-ribaudo nicolo-ribaudo changed the title Support undecorated static accessor in anonymous class expression Support undecorated static accessor in anonymous classes May 14, 2024
@nicolo-ribaudo nicolo-ribaudo merged commit 6e14020 into babel:main May 14, 2024
51 checks passed
@nicolo-ribaudo nicolo-ribaudo deleted the support-anonymous-class-static-accessor branch May 14, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Decorators
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Crash with decorators on anonymous class expression
4 participants