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 |
| // references and binding until babel/babel#4818 resolved | ||
| path.remove(); | ||
| init.remove(); | ||
| next.node.init = t.variableDeclaration("var", declarations); |
There was a problem hiding this comment.
next.replaceWith(t.variableDeclaration("var", declarations))There was a problem hiding this comment.
Can you also fix this one? Use babel path API instead of mutating node.
There was a problem hiding this comment.
Tried & failed with this way, the output eliminated the for-loop
There was a problem hiding this comment.
Oops. It's
init.replaceWith(t.variableDeclaration("var", declarations);and init.remove() should be removed.
There was a problem hiding this comment.
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