erikdesjardins / babel-plugin-transform-dead-code-elimination

Babel 6 fork of babel-plugin-dead-code-elimination.
https://www.npmjs.com/package/babel-plugin-transform-dead-code-elimination
MIT License
8 stars 4 forks source link

assignment removed from shorthand if-statement #10

Closed erikdesjardins closed 8 years ago

erikdesjardins commented 8 years ago

i.e.

if (foo) bar = 5;
var bar = 1;

will remove bar entirely, but removing bar = 5; leaves us with the AST in an invalid state (the if statement's consequent is null).