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(es/compat): Fix async generator #8881

Merged
merged 12 commits into from
Apr 23, 2024
Merged

fix(es/compat): Fix async generator #8881

merged 12 commits into from
Apr 23, 2024

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Apr 22, 2024

@kdy1 kdy1 added this to the Planned milestone Apr 22, 2024
@kdy1 kdy1 self-assigned this Apr 22, 2024
Copy link

changeset-bot bot commented Apr 22, 2024

⚠️ No Changeset found

Latest commit: bacfa6d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@kdy1 kdy1 changed the title fix(es/compat): Fix fix(es/compat): Fix async generator Apr 22, 2024
@kdy1 kdy1 marked this pull request as ready for review April 22, 2024 05:49
@kdy1 kdy1 requested a review from a team as a code owner April 22, 2024 05:49
kodiakhq[bot]
kodiakhq bot previously approved these changes Apr 22, 2024
kodiakhq[bot]
kodiakhq bot previously approved these changes Apr 22, 2024
Copy link
Member Author

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

I'll wait for reviews because I'm not confident.


swc-bump:

  • swc_core
  • swc_ecma_compat_es2017

kodiakhq[bot]
kodiakhq bot previously approved these changes Apr 22, 2024
// yield _iterator.return();
// or
// yield _awaitAsyncGenerator(_iterator.return());
Copy link
Member

@Austaras Austaras Apr 22, 2024

Choose a reason for hiding this comment

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

I don't know how this actually work, but judging from babel code

yield _iterator.return() // normal async function
yield _awaitAsyncGenerator(_iterator.return()) // async generator function

@kdy1
Copy link
Member Author

kdy1 commented Apr 23, 2024

Thank you!

@kdy1 kdy1 enabled auto-merge (squash) April 23, 2024 00:58
@kdy1 kdy1 merged commit 063eabd into swc-project:main Apr 23, 2024
148 checks passed
@kdy1 kdy1 deleted the issue-8880 branch April 23, 2024 01:23
@kdy1 kdy1 modified the milestones: Planned, v1.4.17 Apr 23, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators May 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Async generator for-await loop with no yield incorrectly yields iterator node when targeting es6 or lower
2 participants