Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(es/transformation): Fix wrong syntax context of variables with the same names as catch params #9786

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

CPunisher
Copy link
Member

@CPunisher CPunisher commented Dec 8, 2024

Description:

When hoisting variables, the names of catch params are saved in catch_param_decls permanently in the process. So the following code skips resolving the variables with the same names.

if self.catch_param_decls.contains(&id.sym)

I think this is introduced in #4574. I'm not sure why do that because I didn't find related test cases.

Related issue:

@CPunisher CPunisher requested a review from a team as a code owner December 8, 2024 06:40
Copy link

changeset-bot bot commented Dec 8, 2024

🦋 Changeset detected

Latest commit: 5513a60

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

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

Copy link

codspeed-hq bot commented Dec 8, 2024

CodSpeed Performance Report

Merging #9786 will not alter performance

Comparing CPunisher:fix/catch-decl (5513a60) with main (5a44c6b)

Summary

✅ 194 untouched benchmarks

kdy1
kdy1 previously approved these changes Dec 9, 2024
@kdy1 kdy1 added this to the Planned milestone Dec 9, 2024
@kdy1 kdy1 requested a review from a team as a code owner December 9, 2024 02:37
@kdy1 kdy1 merged commit 5a44c6b into swc-project:main Dec 9, 2024
21 of 22 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.10.1 Dec 9, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Jan 9, 2025
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Wrong syntax context of variables with the same names as catch params
2 participants