mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 08:14:09 -08:00
Fixes small bugs that were found by html4j TCK
This commit is contained in:
parent
8dada3b28c
commit
0ff2b2a1dc
|
@ -21,7 +21,7 @@ $rt_compare = function(a, b) {
|
|||
return a > b ? 1 : a < b ? -1 : 0;
|
||||
}
|
||||
$rt_isInstance = function(obj, cls) {
|
||||
return obj != null && obj.constructor.$meta && $rt_isAssignable(obj.constructor, cls);
|
||||
return obj !== null && !!obj.constructor.$meta && $rt_isAssignable(obj.constructor, cls);
|
||||
}
|
||||
$rt_isAssignable = function(from, to) {
|
||||
if (from === to) {
|
||||
|
|
|
@ -116,8 +116,12 @@ public class JavaScriptConvGenerator implements Generator {
|
|||
writer.outdent().append("} else if (" + type + " === ").appendClass("java.lang.Double")
|
||||
.append(") {").indent().softNewLine();
|
||||
writer.append("return ").appendMethodBody(valueOfDoubleMethod).append("(" + obj + ");").softNewLine();
|
||||
writer.outdent().append("} else if (" + type + " === $rt_intcls()) {").indent().softNewLine();
|
||||
writer.outdent().append("} else if (" + type + " === $rt_intcls() || " + type + " === $rt_bytecls() || " +
|
||||
type + " === $rt_shortcls()) {").indent().softNewLine();
|
||||
writer.append("return " + obj + "|0;").softNewLine();
|
||||
writer.outdent().append("} else if (" + type + " === $rt_doublecls() || " + type + " == $rt_floatcls()) {")
|
||||
.indent().softNewLine();
|
||||
writer.append("return " + obj + ";").softNewLine();
|
||||
writer.outdent().append("} else if (" + type + " === ").appendClass("java.lang.Boolean")
|
||||
.append(") {").indent().softNewLine();
|
||||
writer.append("return ").appendMethodBody(valueOfBooleanMethod).append("(" + obj + "?1:0);").softNewLine();
|
||||
|
|
Loading…
Reference in New Issue
Block a user