From 6bf9a728a9c1fcd304682df1a67ad7cc8339c76f Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 3 Apr 2015 15:11:07 +0400 Subject: [PATCH] Break eliminator now takes in account try/catch statement. See https://github.com/konsoletyper/teavm/issues/93 --- .../src/main/java/org/teavm/javascript/BreakEliminator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/teavm-core/src/main/java/org/teavm/javascript/BreakEliminator.java b/teavm-core/src/main/java/org/teavm/javascript/BreakEliminator.java index 94bb2ef74..b0421551a 100644 --- a/teavm-core/src/main/java/org/teavm/javascript/BreakEliminator.java +++ b/teavm-core/src/main/java/org/teavm/javascript/BreakEliminator.java @@ -138,8 +138,14 @@ class BreakEliminator implements StatementVisitor { @Override public void visit(TryCatchStatement statement) { + Map> oldBlockSuccessors = blockSuccessors; + Set oldOuterStatements = outerStatements; + outerStatements = new HashSet<>(); + blockSuccessors = new HashMap<>(); processSequence(statement.getProtectedBody()); processSequence(statement.getHandler()); + outerStatements = oldOuterStatements; + blockSuccessors = oldBlockSuccessors; } @Override