mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Minor improvements & bugfixes
This commit is contained in:
parent
50686c882d
commit
b7754ea1a5
|
@ -62,13 +62,34 @@ class PropertyMap extends AbstractMap<String, Variable> {
|
|||
Map<String, Variable> vars = new HashMap<>();
|
||||
for (Map.Entry<String, JavaScriptVariable> entry : jsVariables.entrySet()) {
|
||||
JavaScriptVariable jsVar = entry.getValue();
|
||||
String name = debugger.mapField(className, entry.getKey());
|
||||
if (name == null) {
|
||||
continue;
|
||||
String name;
|
||||
if (className.endsWith("[]")) {
|
||||
if (entry.getKey().equals("data")) {
|
||||
name = entry.getKey();
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else if (isNumeric(entry.getKey())) {
|
||||
name = entry.getKey();
|
||||
} else {
|
||||
name = debugger.mapField(className, entry.getKey());
|
||||
if (name == null) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
Value value = new Value(debugger, jsVar.getValue());
|
||||
vars.put(entry.getKey(), new Variable(name, value));
|
||||
}
|
||||
backingMap.compareAndSet(null, vars);
|
||||
}
|
||||
|
||||
private boolean isNumeric(String str) {
|
||||
for (int i = 0; i < str.length(); ++i) {
|
||||
char c = str.charAt(i);
|
||||
if (c < '0' || c > '9') {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -426,6 +426,9 @@ public class SSATransformer {
|
|||
@Override
|
||||
public void visit(UnwrapArrayInstruction insn) {
|
||||
insn.setArray(use(insn.getArray()));
|
||||
for (String debugName : insn.getArray().getDebugNames()) {
|
||||
variableDebugMap.put(insn.getReceiver().getIndex(), debugName + ".data");
|
||||
}
|
||||
insn.setReceiver(define(insn.getReceiver()));
|
||||
}
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@ public class JSNativeGenerator implements Generator, Injector, DependencyPlugin
|
|||
switch (method.getReference().getName()) {
|
||||
case "invoke":
|
||||
case "instantiate":
|
||||
case "function":
|
||||
for (int i = 0; i < method.getReference().parameterCount(); ++i) {
|
||||
method.getVariable(i).addConsumer(new DependencyConsumer() {
|
||||
@Override public void consume(DependencyAgentType type) {
|
||||
|
|
|
@ -3,11 +3,6 @@
|
|||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-archetype-plugin/archetype-descriptor/1.0.0
|
||||
http://maven.apache.org/xsd/archetype-descriptor-1.0.0.xsd"
|
||||
name="TeaVM web application" partial="false">
|
||||
<requiredProperties>
|
||||
<requiredProperty key="package">
|
||||
<defaultValue></defaultValue>
|
||||
</requiredProperty>
|
||||
</requiredProperties>
|
||||
<fileSets>
|
||||
<fileSet filtered="true" packaged="true" encoding="UTF-8">
|
||||
<directory>src/main/java</directory>
|
||||
|
|
|
@ -101,6 +101,10 @@
|
|||
|
||||
<!-- Whether TeaVM should produce source maps file -->
|
||||
<sourceMapsGenerated>true</sourceMapsGenerated>
|
||||
|
||||
<!-- Whether TeaVM should also put source files into output directory,
|
||||
for compatibility with source maps -->
|
||||
<sourceFilesCopied>true</sourceFilesCopied>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
|
|
|
@ -2,8 +2,9 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Main page</title>
|
||||
<script type="text/javascript" src="teavm/runtime.js"></script>
|
||||
<script type="text/javascript" src="teavm/classes.js"></script>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
|
||||
<script type="text/javascript" charset="utf-8" src="teavm/runtime.js"></script>
|
||||
<script type="text/javascript" charset="utf-8" src="teavm/classes.js"></script>
|
||||
</head>
|
||||
<body onload="main()">
|
||||
<!-- TODO: add HTML content -->
|
||||
|
|
Loading…
Reference in New Issue
Block a user