mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Fixes some bugs
This commit is contained in:
parent
e32da9316f
commit
f6927a72af
|
@ -20,6 +20,6 @@ public class AssertNativeGenerator implements Generator {
|
|||
}
|
||||
|
||||
private void generateFail(SourceWriter writer) {
|
||||
writer.append("throw new JUnitAssertionFailure();").newLine();
|
||||
writer.append("throw new Error();").newLine();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
JUnitAssertionFailure = function() {}
|
||||
JUnitAssertionFailure.prototype = new Error();
|
||||
|
||||
currentTestReportBody = null;
|
||||
|
||||
runTestCase = function(instance, methodName, realMethodName) {
|
||||
|
@ -17,17 +14,10 @@ runTestCase = function(instance, methodName, realMethodName) {
|
|||
instance[realMethodName]();
|
||||
statusCell.appendChild(document.createTextNode("ok"));
|
||||
} catch (e) {
|
||||
if (e instanceof JUnitAssertionFailure) {
|
||||
statusCell.appendChild(document.createTextNode("assertion failed"));
|
||||
var exceptionText = document.createElement("pre");
|
||||
exceptionText.appendChild(document.createTextNode(e.stack));
|
||||
exceptionCell.appendChild(exceptionText);
|
||||
} else {
|
||||
statusCell.appendChild(document.createTextNode("unexpected exception"));
|
||||
var exceptionText = document.createElement("pre");
|
||||
exceptionText.appendChild(document.createTextNode(e.stack));
|
||||
exceptionCell.appendChild(exceptionText);
|
||||
}
|
||||
statusCell.appendChild(document.createTextNode("unexpected exception"));
|
||||
var exceptionText = document.createElement("pre");
|
||||
exceptionText.appendChild(document.createTextNode(e.stack));
|
||||
exceptionCell.appendChild(exceptionText);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class DefaultNamingStrategy implements NamingStrategy {
|
|||
if (methodHolder.getModifiers().contains(ElementModifier.STATIC) ||
|
||||
method.getDescriptor().getName().equals("<init>") ||
|
||||
methodHolder.getLevel() == AccessLevel.PRIVATE) {
|
||||
String key = method.getClassName() + "#" + method.toString();
|
||||
String key = method.toString();
|
||||
String alias = privateAliases.get(key);
|
||||
if (alias == null) {
|
||||
alias = aliasProvider.getAlias(method);
|
||||
|
@ -67,7 +67,7 @@ public class DefaultNamingStrategy implements NamingStrategy {
|
|||
}
|
||||
return alias;
|
||||
} else {
|
||||
String key = method.toString();
|
||||
String key = method.getDescriptor().toString();
|
||||
String alias = aliases.get(key);
|
||||
if (alias == null) {
|
||||
alias = aliasProvider.getAlias(method);
|
||||
|
|
|
@ -75,8 +75,8 @@ public class Renderer implements ExprVisitor, StatementVisitor {
|
|||
writer.append("for (var i = 0; i < str.length; i = (i + 1) | 0) {").indent().newLine();
|
||||
writer.append("characters[i] = str.charCodeAt(i);").newLine();
|
||||
writer.outdent().append("}").newLine();
|
||||
writer.append("return $rt_init(").appendClass("java.lang.String").append(", '")
|
||||
.appendMethod(stringCons).append("', characters);").newLine();
|
||||
writer.append("return ").appendClass("java.lang.String").append(".")
|
||||
.appendMethod(stringCons).append("(characters);").newLine();
|
||||
writer.outdent().append("}").newLine();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user