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/renamer): Ensure that param and function body are in same scope #7271

Merged
merged 2 commits into from
Apr 15, 2023

Conversation

Austaras
Copy link
Member

@Austaras Austaras commented Apr 14, 2023

Description:

The probleam arises in L235 of swc_ecma_transforms_base/src/rename/mod.rs

unit!(visit_mut_fn_decl, FnDecl, true);

which calls get_map and evals to

node.visit_children_with(&mut v);

with FnDecl and Analyzer in L132. However in Analyzer, a visit to raw function was not overloaded, so function arguments and function body are considered different scope.

BREAKING CHANGE:

Related issue (if exists):
closes #7261

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 so much!


swc-bump:

  • swc_ecma_transforms_base

@kdy1 kdy1 changed the title fix(es/base): Ensure param and function body in same scope in mangler fix(es/renamer): Ensure that param and function body are in same scope Apr 14, 2023
@kdy1 kdy1 enabled auto-merge (squash) April 14, 2023 22:08
@kdy1 kdy1 added this to the Planned milestone Apr 14, 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 93a264c into swc-project:main Apr 15, 2023
@kdy1 kdy1 modified the milestones: Planned, v1.3.51 Apr 15, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators May 16, 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.

Mangling redeclares variable in destructuring when eval() is present
3 participants