From 4c70cf68281e8e99d238f4bc145f450d2ca0fe07 Mon Sep 17 00:00:00 2001 From: konsoletyper Date: Thu, 30 Jan 2014 17:44:47 +0400 Subject: [PATCH] Fixes error generating minfied JS --- teavm-core/src/main/java/org/teavm/javascript/Renderer.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/teavm-core/src/main/java/org/teavm/javascript/Renderer.java b/teavm-core/src/main/java/org/teavm/javascript/Renderer.java index 01ee5f0eb..ec06a0f4d 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/Renderer.java +++ b/teavm-core/src/main/java/org/teavm/javascript/Renderer.java @@ -393,13 +393,14 @@ public class Renderer implements ExprVisitor, StatementVisitor { part.acceptVisitor(this); } if (!statement.getAlternative().isEmpty()) { - writer.outdent().append("}").ws().append("else").ws(); + writer.outdent().append("}").ws(); if (statement.getAlternative().size() == 1 && statement.getAlternative().get(0) instanceof ConditionalStatement) { statement = (ConditionalStatement)statement.getAlternative().get(0); + writer.append("else "); continue; } - writer.append("{").indent().softNewLine(); + writer.append("else").ws().append("{").indent().softNewLine(); for (Statement part : statement.getAlternative()) { part.acceptVisitor(this); }