-
-
Notifications
You must be signed in to change notification settings - Fork 225
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(merge-sibling-var): force recalc ref when concatenating for-loop vars (#485) #713
Conversation
Not sure how to write test as some issues only occur when using mergeVars, deadcode or mangle at the same time |
Thanks a lot. I'll merge it with tests. You can add test cases in |
path.remove(); | ||
init.remove(); | ||
next.node.init = t.variableDeclaration("var", declarations); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
next.replaceWith(t.variableDeclaration("var", declarations))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you also fix this one? Use babel path API instead of mutating node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tried & failed with this way, the output eliminated the for-loop
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. It's
init.replaceWith(t.variableDeclaration("var", declarations);
and init.remove()
should be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, thanks for correcting
Hi! This is breaking the build in mozilla/hawk#223 - I don't suppose a point release could be made that includes this fix? :-) |
@edmorley Every commit to master is released as a |
I just want to chime in that this is also breaking our build, so we can't use babel-minify 0.2.0 right now. It would be great if we could get a non-canary release that includes this fix. |
@allanjackson Its done. use 0.3.0 |
Thanks! |
Fix #594
Fix #430
Fix #412
Fix #554
Fix #581
Fix #477
Fix #720
Fix #485