diff --git a/lib/6to5/transformation/transformers/minification/dead-code-elimination.js b/lib/6to5/transformation/transformers/minification/dead-code-elimination.js index eb94292989..6a7fdb8a57 100644 --- a/lib/6to5/transformation/transformers/minification/dead-code-elimination.js +++ b/lib/6to5/transformation/transformers/minification/dead-code-elimination.js @@ -4,6 +4,7 @@ exports.optional = true; exports.ExpressionStatement = function (node) { // remove consequenceless expressions such as local variables and literals + // note: will remove directives // // var foo = true; foo; -> var foo = true; // "foo"; -> @@ -66,8 +67,7 @@ exports.IfStatement = { // if (foo) {} else { bar; } -> if (!foo) { bar; } // - if (t.blockStatement(consequent) && !consequent.body.length && - t.isBlockStatement(alternate) && alternate.body.length) { + if (t.blockStatement(consequent) && !consequent.body.length && t.isBlockStatement(alternate) && alternate.body.length) { node.consequent = node.alternate; node.alternate = null; node.test = t.unaryExpression("!", test, true);