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 03eb93654..3d432424b 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/OptimizingVisitor.java +++ b/teavm-core/src/main/java/org/teavm/javascript/OptimizingVisitor.java @@ -289,6 +289,7 @@ class OptimizingVisitor implements StatementVisitor, ExprVisitor { List backup = resultSequence; resultSequence = new ArrayList<>(); processSequenceImpl(statements); + wieldTryCatch(resultSequence); List result = new ArrayList<>(); for (Statement part : resultSequence) { if (part != null) { @@ -321,7 +322,6 @@ class OptimizingVisitor implements StatementVisitor, ExprVisitor { return false; } } - wieldTryCatch(statements); return true; }