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 loose mode of the spread pass #7760

Merged
merged 2 commits into from
Aug 6, 2023

Conversation

isker
Copy link
Contributor

@isker isker commented Aug 5, 2023

As per the comments, we have to carefully nest non-spread arguments in arrays before passing them to Array.prototype.concat. This is the same approach babel takes in loose array spread transpilation.

Fixes #7736.

As per the comments, we have to carefully nest non-spread arguments in
arrays before passing them to Array.prototype.concat. This is the same
approach babel takes in loose array spread transpilation.

Fixes swc-project#7736.
@CLAassistant
Copy link

CLAassistant commented Aug 5, 2023

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.

@isker
Copy link
Contributor Author

isker commented Aug 5, 2023

Compare to what babel does.

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 added this to the Planned milestone Aug 6, 2023
@kdy1 kdy1 changed the title Fix es2015 loose spread transpilation fix(es/compat): Fix loose mode of the spread pass Aug 6, 2023
@kdy1 kdy1 enabled auto-merge (squash) August 6, 2023 20:30
@kdy1 kdy1 self-assigned this Aug 6, 2023
Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 merged commit b69ae8f into swc-project:main Aug 6, 2023
127 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.3.75 Aug 8, 2023
kdy1 pushed a commit to kdy1/swc that referenced this pull request Aug 15, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Sep 7, 2023
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.

Loose transpilation of spreads to ES5 is incorrect
4 participants