add missing is - fixes #931 - thanks @neVERberleRfellerER

This commit is contained in:
Sebastian McKenzie 2015-03-03 10:38:18 +11:00
parent f3d2b2bb81
commit bafa3e0d4c

View File

@ -77,7 +77,7 @@ export var IfStatement = {
// if (foo) {} else { bar; } -> if (!foo) { bar; }
//
if (t.blockStatement(consequent) && consequent.body && !consequent.body.length && t.isBlockStatement(alternate) && alternate.body && alternate.body.length) {
if (t.isBlockStatement(consequent) && !consequent.body.length && t.isBlockStatement(alternate) && alternate.body.length) {
node.consequent = node.alternate;
node.alternate = null;
node.test = t.unaryExpression("!", test, true);