Fixes error generating minfied JS

This commit is contained in:
konsoletyper 2014-01-30 17:44:47 +04:00
parent 3496907f0e
commit 4c70cf6828

View File

@ -393,13 +393,14 @@ public class Renderer implements ExprVisitor, StatementVisitor {
part.acceptVisitor(this); part.acceptVisitor(this);
} }
if (!statement.getAlternative().isEmpty()) { if (!statement.getAlternative().isEmpty()) {
writer.outdent().append("}").ws().append("else").ws(); writer.outdent().append("}").ws();
if (statement.getAlternative().size() == 1 && if (statement.getAlternative().size() == 1 &&
statement.getAlternative().get(0) instanceof ConditionalStatement) { statement.getAlternative().get(0) instanceof ConditionalStatement) {
statement = (ConditionalStatement)statement.getAlternative().get(0); statement = (ConditionalStatement)statement.getAlternative().get(0);
writer.append("else ");
continue; continue;
} }
writer.append("{").indent().softNewLine(); writer.append("else").ws().append("{").indent().softNewLine();
for (Statement part : statement.getAlternative()) { for (Statement part : statement.getAlternative()) {
part.acceptVisitor(this); part.acceptVisitor(this);
} }