mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Fixes bugs
This commit is contained in:
parent
15478da9ed
commit
ad3fa3b531
|
@ -508,6 +508,9 @@ public class TString extends TObject implements TSerializable, TComparable<TStri
|
|||
if (this == other) {
|
||||
return true;
|
||||
}
|
||||
if (other == null) {
|
||||
return false;
|
||||
}
|
||||
if (length() != other.length()) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -56,10 +56,9 @@ public final class TSystem extends TObject {
|
|||
return null;
|
||||
}
|
||||
|
||||
public static TString getProperty(@SuppressWarnings("unused") TString key,
|
||||
@SuppressWarnings("unused") TString def) {
|
||||
// TODO: make implementation
|
||||
return null;
|
||||
public static TString getProperty(TString key, TString def) {
|
||||
TString value = getProperty(key);
|
||||
return value != null ? value : def;
|
||||
}
|
||||
|
||||
@GeneratedBy(SystemNativeGenerator.class)
|
||||
|
|
|
@ -244,28 +244,29 @@ public class Renderer implements ExprVisitor, StatementVisitor, RenderingContext
|
|||
writer.ws().append("});").newLine().outdent();
|
||||
List<MethodNode> nonInitMethods = new ArrayList<>();
|
||||
List<MethodNode> virtualMethods = new ArrayList<>();
|
||||
|
||||
writer.append("function ").appendClass(cls.getName()).append("_$clinit()").ws()
|
||||
.append("{").softNewLine().indent();
|
||||
writer.appendClass(cls.getName()).append("_$clinit").ws().append("=").ws()
|
||||
.append("function(){};").newLine();
|
||||
List<String> stubNames = new ArrayList<>();
|
||||
for (MethodNode method : cls.getMethods()) {
|
||||
if (!method.getModifiers().contains(NodeModifier.STATIC) &&
|
||||
!method.getReference().getName().equals("<init>")) {
|
||||
nonInitMethods.add(method);
|
||||
} else {
|
||||
renderBody(method, true);
|
||||
stubNames.add(naming.getFullNameFor(method.getReference()));
|
||||
}
|
||||
}
|
||||
MethodHolder methodHolder = classSource.get(cls.getName()).getMethod(
|
||||
new MethodDescriptor("<clinit>", ValueType.VOID));
|
||||
if (methodHolder != null) {
|
||||
writer.appendMethodBody(new MethodReference(cls.getName(), methodHolder.getDescriptor()))
|
||||
.append("();").softNewLine();
|
||||
}
|
||||
writer.outdent().append("}").newLine();
|
||||
if (!cls.getModifiers().contains(NodeModifier.INTERFACE)) {
|
||||
writer.append("function ").appendClass(cls.getName()).append("_$clinit()").ws()
|
||||
.append("{").softNewLine().indent();
|
||||
writer.appendClass(cls.getName()).append("_$clinit").ws().append("=").ws()
|
||||
.append("function(){};").newLine();
|
||||
List<String> stubNames = new ArrayList<>();
|
||||
for (MethodNode method : cls.getMethods()) {
|
||||
if (!method.getModifiers().contains(NodeModifier.STATIC) &&
|
||||
!method.getReference().getName().equals("<init>")) {
|
||||
nonInitMethods.add(method);
|
||||
} else {
|
||||
renderBody(method, true);
|
||||
stubNames.add(naming.getFullNameFor(method.getReference()));
|
||||
}
|
||||
}
|
||||
MethodHolder methodHolder = classSource.get(cls.getName()).getMethod(
|
||||
new MethodDescriptor("<clinit>", ValueType.VOID));
|
||||
if (methodHolder != null) {
|
||||
writer.appendMethodBody(new MethodReference(cls.getName(), methodHolder.getDescriptor()))
|
||||
.append("();").softNewLine();
|
||||
}
|
||||
writer.outdent().append("}").newLine();
|
||||
for (MethodNode method : cls.getMethods()) {
|
||||
cls.getMethods();
|
||||
if (!method.getModifiers().contains(NodeModifier.STATIC)) {
|
||||
|
@ -286,6 +287,7 @@ public class Renderer implements ExprVisitor, StatementVisitor, RenderingContext
|
|||
writer.append("]);").newLine();
|
||||
}
|
||||
}
|
||||
|
||||
for (MethodNode method : nonInitMethods) {
|
||||
renderBody(method, false);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user