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 function hoisting with early return branch simplification #1539

Merged
merged 4 commits into from Apr 8, 2021

Conversation

devongovett
Copy link
Contributor

This fixes an issue in the branch simplifier where functions declared after a return statement were removed. These functions need to be left in place and are accessible via hoisting. Adjusted to move the declarations before the return statement along with var declarations.

@kdy1 kdy1 added this to the v1.2.52 milestone Apr 4, 2021
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 a lot!
I found one issue related to usage of generics

});
decls.extend(ids);
}
_ => {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't this drop module items?
I'll see the whole code.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it should be
Err(item) => buf.push(item)

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.

LGTM. Thanks!

@kdy1 kdy1 enabled auto-merge (squash) April 8, 2021 04:28
@kdy1 kdy1 merged commit ee641ba into swc-project:master Apr 8, 2021
@swc-project swc-project locked as resolved and limited conversation to collaborators Nov 11, 2022
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