From bc41b12f0eab18351436fedda8f817189b707f56 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Thu, 7 Feb 2019 17:15:32 +0300 Subject: [PATCH] JS: fix bug in generating async functions in minified mode --- .../java/org/teavm/backend/javascript/rendering/Renderer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/org/teavm/backend/javascript/rendering/Renderer.java b/core/src/main/java/org/teavm/backend/javascript/rendering/Renderer.java index e0df52355..b3aec0663 100644 --- a/core/src/main/java/org/teavm/backend/javascript/rendering/Renderer.java +++ b/core/src/main/java/org/teavm/backend/javascript/rendering/Renderer.java @@ -402,7 +402,7 @@ public class Renderer implements RenderingManager { throws IOException { boolean isAsync = asyncMethods.contains(clinit.getReference()); - String clinitCalled = naming.getNameFor(cls.getName() + "_$clinitCalled"); + String clinitCalled = naming.getNameFor(cls.getName()) + "_$clinitCalled"; if (isAsync) { writer.append("var ").append(clinitCalled).ws().append("=").ws().append("false;").softNewLine(); } @@ -419,7 +419,7 @@ public class Renderer implements RenderingManager { writer.append(context.pointerName()).ws().append("=").ws().appendFunction("$rt_nativeThread") .append("().pop();").softNewLine(); writer.outdent().append("}").ws(); - writer.append("else if").ws().append("(").appendClass(cls.getName()).append("_$clinitCalled)").ws() + writer.append("else if").ws().append("(").append(clinitCalled).append(")").ws() .append("{").indent().softNewLine(); writer.append("return;").softNewLine(); writer.outdent().append("}").softNewLine();