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

Return statement arg not being visited for VisitAll implementation #1967

Closed
tmpfs opened this issue Jul 27, 2021 · 1 comment · Fixed by #2077
Closed

Return statement arg not being visited for VisitAll implementation #1967

tmpfs opened this issue Jul 27, 2021 · 1 comment · Fixed by #2077
Assignees
Labels
Milestone

Comments

@tmpfs
Copy link
Contributor

tmpfs commented Jul 27, 2021

Describe the bug

It appears that when implementing VisitAll and using the visit_expr handler that the arg field of ReturnStmt is not being visited. It is declared as Option<Box<Expr>> so I wonder if the issue is to do with the field being optional.

Config

N/A

Expected behavior

I expect visit_expr to be called when arg is Some.

Additional context

I am working around this by also implementing visit_stmt for the moment.

@tmpfs tmpfs added the C-bug label Jul 27, 2021
tmpfs added a commit to LavaMoat/basalt that referenced this issue Jul 27, 2021
Add workaround for visit_expr not firing for return statements and yield expressions.

See: swc-project/swc#1967
@kdy1 kdy1 modified the milestones: v1.2.67, v1.2.68, v1.2.72, v1.2.73 Jul 27, 2021
@kdy1 kdy1 modified the milestones: v1.2.73, v1.2.74, v1.2.75, v1.2.76, v1.2.77, v1.2.78 Aug 4, 2021
@kdy1 kdy1 self-assigned this Aug 14, 2021
kdy1 added a commit to kdy1/swc that referenced this issue Aug 14, 2021
kdy1 added a commit that referenced this issue Aug 14, 2021
swc_ecma_visit:
 - Ensure that #1967 is wrong. (#1967)

swc:
 - Add a test for #1107. (#1107)

node:
 - Make optional fields optional. (#1947)
@swc-bot
Copy link
Collaborator

swc-bot commented Oct 22, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Oct 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

3 participants