diff --git a/html4j/src/main/java/org/teavm/html4j/JavaScriptConv.java b/html4j/src/main/java/org/teavm/html4j/JavaScriptConv.java index 2c4f53846..8ef623d13 100644 --- a/html4j/src/main/java/org/teavm/html4j/JavaScriptConv.java +++ b/html4j/src/main/java/org/teavm/html4j/JavaScriptConv.java @@ -17,10 +17,6 @@ package org.teavm.html4j; import org.teavm.backend.javascript.spi.GeneratedBy; -/** - * - * @author Alexey Andreev - */ public final class JavaScriptConv { private JavaScriptConv() { } diff --git a/html4j/src/main/java/org/teavm/html4j/JavaScriptConvGenerator.java b/html4j/src/main/java/org/teavm/html4j/JavaScriptConvGenerator.java index 500923af8..a415a1b0f 100644 --- a/html4j/src/main/java/org/teavm/html4j/JavaScriptConvGenerator.java +++ b/html4j/src/main/java/org/teavm/html4j/JavaScriptConvGenerator.java @@ -21,10 +21,6 @@ import org.teavm.backend.javascript.spi.Generator; import org.teavm.backend.javascript.spi.GeneratorContext; import org.teavm.model.*; -/** - * - * @author Alexey Andreev - */ public class JavaScriptConvGenerator implements Generator { static final MethodReference intValueMethod = new MethodReference(Integer.class, "intValue", int.class); static final MethodReference booleanValueMethod = new MethodReference(Boolean.class, "booleanValue", boolean.class); @@ -66,7 +62,7 @@ public class JavaScriptConvGenerator implements Generator { private void generateToJavaScript(GeneratorContext context, SourceWriter writer) throws IOException { String obj = context.getParameterName(1); writer.append("if (" + obj + " === null || " + obj + " === undefined) {").softNewLine().indent(); - writer.append("return " + obj + ";").softNewLine(); + writer.append("return null;").softNewLine(); writer.outdent().append("} else if (typeof " + obj + " === 'number') {").indent().softNewLine(); writer.append("return " + obj + ";").softNewLine(); @@ -118,7 +114,7 @@ public class JavaScriptConvGenerator implements Generator { String type = context.getParameterName(2); writer.append("if (" + obj + " === null || " + obj + " === undefined)").ws().append("{") .softNewLine().indent(); - writer.append("return " + obj + ";").softNewLine(); + writer.append("return null;").softNewLine(); writer.outdent().append("} else if (" + type + ".$meta.item) {").indent().softNewLine(); writer.append("var arr = $rt_createArray(" + type + ".$meta.item, " + obj + ".length);").softNewLine(); writer.append("for (var i = 0; i < arr.data.length; ++i) {").indent().softNewLine(); diff --git a/html4j/src/test/java/org/teavm/html4j/test/JavaScriptTCKTest.java b/html4j/src/test/java/org/teavm/html4j/test/JavaScriptTCKTest.java index 47e1763d5..48022a357 100644 --- a/html4j/src/test/java/org/teavm/html4j/test/JavaScriptTCKTest.java +++ b/html4j/src/test/java/org/teavm/html4j/test/JavaScriptTCKTest.java @@ -56,12 +56,12 @@ public class JavaScriptTCKTest extends JavaScriptBodyTest { @Test @Override public void callbackUnknownArray() { -// super.callbackUnknownArray(); + super.callbackUnknownArray(); } @Test @Override public void callbackUnknown() { -// super.callbackUnknown(); + super.callbackUnknown(); } @Test @Override @@ -71,7 +71,7 @@ public class JavaScriptTCKTest extends JavaScriptBodyTest { @Test @Override public void returnUnknownArray() { -// super.returnUnknownArray(); + super.returnUnknownArray(); } @Test @Override @@ -81,7 +81,7 @@ public class JavaScriptTCKTest extends JavaScriptBodyTest { @Test @Override public void returnUnknown() { -// super.returnUnknown(); + super.returnUnknown(); } @Test @Override @@ -236,7 +236,7 @@ public class JavaScriptTCKTest extends JavaScriptBodyTest { @Test @Override public void toStringOfAnEnum() { -// super.toStringOfAnEnum(); + //super.toStringOfAnEnum(); } @Test @Override