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/visit): Fix handling of Program of AndThen #7120

Merged
merged 1 commit into from Mar 22, 2023

Conversation

JSerFeng
Copy link
Contributor

Description:

Visitor used in AndThen or Repeat cannot invoke fold_program

BREAKING CHANGE:

Related issue (if exists):

@kdy1
Copy link
Member

kdy1 commented Mar 22, 2023

The default impl is enough

@kdy1 kdy1 closed this Mar 22, 2023
@JSerFeng
Copy link
Contributor Author

JSerFeng commented Mar 22, 2023

The default impl is enough

But imagine I have a pass rely on fold_program, others uses my pass by chain!(pass, pass2), then my pass is not working correctly as my pass's fold_program can not be called by AndThen

@kdy1 kdy1 reopened this Mar 22, 2023
@kdy1
Copy link
Member

kdy1 commented Mar 22, 2023

Can you add a test case for such case?

@JSerFeng JSerFeng force-pushed the fix/visitor-and-then branch 3 times, most recently from f01a720 to 4ad30bc Compare March 22, 2023 09:47
@JSerFeng
Copy link
Contributor Author

Can you add a test case for such case?

Done

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_visit

crates/swc_ecma_visit/visitor.rs Outdated Show resolved Hide resolved
@kdy1 kdy1 changed the title fix(swc_visit): 🐛 visit program in AndThen and Repeat fix(es/visit): Fix handling of Program of AndThen Mar 22, 2023
@kdy1 kdy1 enabled auto-merge (squash) March 22, 2023 11:30
@kdy1 kdy1 added this to the Planned milestone Mar 22, 2023
@kdy1 kdy1 merged commit d50689e into swc-project:main Mar 22, 2023
130 checks passed
@kdy1 kdy1 modified the milestones: Planned, v1.3.43, v1.3.44 Mar 29, 2023
@swc-project swc-project locked as resolved and limited conversation to collaborators Apr 29, 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