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 issue with generating async functions inside loops. #6479

Merged
merged 1 commit into from
Nov 9, 2023

Conversation

cristianoc
Copy link
Collaborator

@cristianoc cristianoc commented Nov 8, 2023

Fixes #6444

The example comes from a code transformation that deals with closures inside loops. Specifically, since var is function scope, and immediately-executed function is generated to capture the variable.
The generated code was missing an async in the returned function, but also an await on the outside.

Note this entire transformation becomes unnecessary after #6102

@cristianoc
Copy link
Collaborator Author

@zth @cknitt can you think of other tests to try? Asking as this becomes the only test that triggers this issue, and 2 changes were required in the generated code, so making sure nothing is missing.

Copy link
Collaborator

@zth zth left a comment

Choose a reason for hiding this comment

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

Nothing I can think of OTOH. Landing let support is going to be great, so we can get rid of these things.

@cristianoc cristianoc merged commit 182c6e8 into master Nov 9, 2023
14 checks passed
@cristianoc cristianoc deleted the async_inside_loop branch November 9, 2023 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants