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: rewriteBindingInitVisitor should skip on scopable node #10764

Merged
merged 1 commit into from Nov 26, 2019

Conversation

@JLHwung
Copy link
Contributor

JLHwung commented Nov 25, 2019

Q                       A
Fixed Issues? Fixes #9346
Patch: Bug Fix? Yes
Tests Added + Pass? Yes
License MIT

The rewriteBindingInitVisitor is used in module transform helper to inject exports statement after ExportDeclaration. Since ExportDeclaration is only allowed in top-level scope, it should skip when it visits a scopable node. Therefore the Function and ClassProperty visitor should be replaced by Scope visitor.

This issue impacts all module related transforms.

@nicolo-ribaudo nicolo-ribaudo merged commit 4e774b7 into babel:master Nov 26, 2019
4 of 5 checks passed
4 of 5 checks passed
test262 Workflow: test262
Details
Travis CI - Pull Request Build Passed
Details
codecov/project 88.13% (target 80%)
Details
e2e Workflow: e2e
Details
test Workflow: test
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.