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

feat(es/base): Make scope context same to the declared variable #7095

Merged
merged 1 commit into from Mar 19, 2023

Conversation

Austaras
Copy link
Member

Description:
Mark scope with the same Mark as the declared variables inside them.

This PR may cause performance regression in non compress use cases, but the effect should be negligible.

BREAKING CHANGE:

Related issue (if exists):

@Austaras
Copy link
Member Author

And, as a side note, the whole Mark thing is not necessary for SWC. rustc uses Mark to mark which macro code come from, and in SWC Mark is used in two cases: variable shadowing as showed in this PR, and provide some additional information as in mark pure in compress. If the latter usage can be eliminated, we could use a single AtomicUSize to provide for all SyntaxContext.

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.

swc-bump:

  • swc_ecma_transforms_base

@kdy1
Copy link
Member

kdy1 commented Mar 19, 2023

I'm unsure if it's fine to simplify' SyntaxContext' to single atomic usize at the moment.

@kdy1 kdy1 merged commit 0f09e35 into swc-project:main Mar 19, 2023
129 checks passed
@kdy1 kdy1 added this to the Planned milestone Mar 19, 2023
@Austaras
Copy link
Member Author

No worry, even if it is, I currently don't have the capacity to apply such huge change.

@kdy1 kdy1 modified the milestones: Planned, v1.3.42 Mar 22, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Apr 21, 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.

None yet

2 participants