Alexey Andreev 2015-02-20 17:09:57 +04:00
parent 69857af688
commit d929181e81

View File

@ -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("<clinit>")) {
if (method.getAnnotations().get(Sync.class.getName()) == null) {
AnnotationHolder annot = new AnnotationHolder(Sync.class.getName());
method.getAnnotations().add(annot);
}
}
}
}