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

Fix decorator bare yield await #16484

Merged
merged 3 commits into from May 9, 2024

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented May 9, 2024

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

In this PR we call the yield await from the decorator node so that it works for the bare yield / await expressions. For class decorators we also plug in the usesFnContext to avoid function context variables / yield / await expressions being inlined within the static block.

@JLHwung JLHwung added PR: Bug Fix 🐛 A type of pull request used for our changelog categories Spec: Decorators labels May 9, 2024
@babel-bot
Copy link
Collaborator

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

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

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

Thanks!

@JLHwung JLHwung merged commit c1bf7d7 into babel:main May 9, 2024
52 checks passed
@JLHwung JLHwung deleted the fix-decorator-bare-yield-await branch May 9, 2024 22:03
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]: Await in a class decorator is not properly transpiled
4 participants