Skip to content

In for-await-of, only call return() for an abrupt completion in user code#51297

Merged
rbuckton merged 1 commit intomainfrom
fix50525
Oct 28, 2022
Merged

In for-await-of, only call return() for an abrupt completion in user code#51297
rbuckton merged 1 commit intomainfrom
fix50525

Conversation

@rbuckton
Copy link
Copy Markdown
Contributor

This wraps user code in a for-await-of statement so that we only call iter.return() when user code exits abruptly. This better aligns with ForIn/OfBodyEvaluation which only calls IteratorClose when there is an abrupt completion in the body.

Fixes #50525

Loading
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Milestone Bug PRs that fix a bug with a specific milestone

Projects

None yet

Development

Successfully merging this pull request may close these issues.

for await transform incorrectly calls return when next throws

3 participants