diff --git a/teavm-platform/src/main/java/org/teavm/platform/plugin/AsyncMethodProcessor.java b/teavm-platform/src/main/java/org/teavm/platform/plugin/AsyncMethodProcessor.java index 9bc0b6564..1a8aa9e19 100644 --- a/teavm-platform/src/main/java/org/teavm/platform/plugin/AsyncMethodProcessor.java +++ b/teavm-platform/src/main/java/org/teavm/platform/plugin/AsyncMethodProcessor.java @@ -19,6 +19,7 @@ import org.teavm.dependency.PluggableDependency; import org.teavm.diagnostics.Diagnostics; import org.teavm.javascript.spi.Async; import org.teavm.javascript.spi.GeneratedBy; +import org.teavm.javascript.spi.Sync; import org.teavm.model.*; import org.teavm.platform.async.AsyncCallback; @@ -55,6 +56,11 @@ public class AsyncMethodProcessor implements ClassHolderTransformer { annot.getValues().put("value", new AnnotationValue(ValueType.parse(AsyncMethodGenerator.class))); method.getAnnotations().add(annot); } + } else if (method.getName().equals("")) { + if (method.getAnnotations().get(Sync.class.getName()) == null) { + AnnotationHolder annot = new AnnotationHolder(Sync.class.getName()); + method.getAnnotations().add(annot); + } } } }