diff --git a/teavm-core/src/main/java/org/teavm/javascript/OptimizingVisitor.java b/teavm-core/src/main/java/org/teavm/javascript/OptimizingVisitor.java index f1dfa0009..de5bf6203 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/OptimizingVisitor.java +++ b/teavm-core/src/main/java/org/teavm/javascript/OptimizingVisitor.java @@ -45,6 +45,14 @@ class OptimizingVisitor implements StatementVisitor, ExprVisitor { @Override public void visit(BinaryExpr expr) { + switch (expr.getOperation()) { + case AND: + case OR: + resultExpr = expr; + return; + default: + break; + } expr.getSecondOperand().acceptVisitor(this); Expr b = resultExpr; expr.getFirstOperand().acceptVisitor(this); 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 eb34438d9..8f1901fa0 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/Renderer.java +++ b/teavm-core/src/main/java/org/teavm/javascript/Renderer.java @@ -1149,9 +1149,6 @@ public class Renderer implements ExprVisitor, StatementVisitor, RenderingContext public void visit(NewArrayExpr expr) { try { ValueType type = expr.getType(); - while (type instanceof ValueType.Array) { - type = ((ValueType.Array)type).getItemType(); - } if (type instanceof ValueType.Primitive) { switch (((ValueType.Primitive)type).getKind()) { case BOOLEAN: