mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Merge branch 'master' of https://github.com/konsoletyper/teavm
This commit is contained in:
commit
da3802d9c5
|
@ -33,6 +33,8 @@ public final class Platform {
|
|||
private Platform() {
|
||||
}
|
||||
|
||||
private static boolean newInstancePrepared;
|
||||
|
||||
@InjectedBy(PlatformGenerator.class)
|
||||
public static native PlatformObject getPlatformObject(Object obj);
|
||||
|
||||
|
@ -85,7 +87,10 @@ public final class Platform {
|
|||
public static native int nextObjectId();
|
||||
|
||||
public static <T> T newInstance(PlatformClass cls) {
|
||||
if (!newInstancePrepared) {
|
||||
prepareNewInstance();
|
||||
newInstancePrepared = true;
|
||||
}
|
||||
return newInstanceImpl(cls);
|
||||
}
|
||||
|
||||
|
|
|
@ -117,9 +117,6 @@ public class PlatformGenerator implements Generator, Injector, DependencyPlugin
|
|||
.appendMethodBody(method.getReference()).append(";").softNewLine();
|
||||
}
|
||||
}
|
||||
writer.appendMethodBody(Platform.class, "newInstance", PlatformClass.class, Object.class).ws().append('=').ws()
|
||||
.appendMethodBody(Platform.class, "newInstanceImpl", PlatformClass.class, Object.class)
|
||||
.append(";").softNewLine();
|
||||
}
|
||||
|
||||
private void generateNewInstance(GeneratorContext context, SourceWriter writer) throws IOException {
|
||||
|
|
Loading…
Reference in New Issue
Block a user