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): counteract unrolling of awaited async arrays in generator #5965

Merged
merged 7 commits into from Sep 27, 2022

Conversation

finnboeger
Copy link
Contributor

@finnboeger finnboeger commented Sep 27, 2022

Description:
This is a workaround addressing the issue #5951 by wrapping the arguments of the .concat call in individual arrays to counteract the unrolling done by concat.

A different way of handling the problem would be to push the arguments to _tmp before the return statement and then use _tmp in the apply call. However I'm not comfortable enough with the codebase to implement it that way.

BREAKING CHANGE:
None afaik, all tests in crates/swc complete successfully and anything that depended on the broken implementation would not have worked with a different transformer.

Related issue (if exists):

@CLAassistant
Copy link

CLAassistant commented Sep 27, 2022

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copy link
Member

@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.

Thanks!

crates/swc_ecma_transforms_compat/src/es2015/generator.rs Outdated Show resolved Hide resolved
@kdy1 kdy1 added this to the Planned milestone Sep 27, 2022
@kdy1 kdy1 self-assigned this Sep 27, 2022
Copy link
Member

@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.

Thank you!


swc-bump:

  • swc_ecma_transforms_compat

@kdy1 kdy1 enabled auto-merge (squash) September 27, 2022 13:18
@kdy1 kdy1 merged commit 1f892cd into swc-project:main Sep 27, 2022
@kdy1 kdy1 modified the milestones: Planned, v1.3.4 Sep 30, 2022
@finnboeger finnboeger deleted the await-call-expression-array branch October 4, 2022 14:35
@swc-project swc-project locked as resolved and limited conversation to collaborators Nov 4, 2022
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.

asyncToGenerator function unrolls secondary parameter if it is an array
3 participants