diff --git a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java index 016b67253..b64d4305b 100644 --- a/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java +++ b/teavm-classlib/src/main/java/org/teavm/classlib/java/lang/TMath.java @@ -93,7 +93,7 @@ public final class TMath extends TObject { public static native double atan2(double y, double x); public static int round(float a) { - return (int)(a + 1.5f); + return (int)(a + 0.5f); } public static long round(double a) { diff --git a/teavm-core/src/main/java/org/teavm/parsing/ProgramParser.java b/teavm-core/src/main/java/org/teavm/parsing/ProgramParser.java index 123619605..c4205da2d 100644 --- a/teavm-core/src/main/java/org/teavm/parsing/ProgramParser.java +++ b/teavm-core/src/main/java/org/teavm/parsing/ProgramParser.java @@ -485,7 +485,12 @@ public class ProgramParser implements VariableDebugInformation { } @Override - public void visitMethodInsn(int opcode, String owner, String name, String desc) { + public void visitInvokeDynamicInsn(String name, String desc, Handle bsm, Object... bsmArgs) { + throw new IllegalStateException("InvokeDynamic is not supported in TeaVM"); + } + + @Override + public void visitMethodInsn(int opcode, String owner, String name, String desc, boolean itf) { switch (opcode) { case Opcodes.INVOKEINTERFACE: case Opcodes.INVOKEVIRTUAL: diff --git a/teavm-core/src/main/resources/org/teavm/javascript/runtime.js b/teavm-core/src/main/resources/org/teavm/javascript/runtime.js index 142d1cc95..759869cbb 100644 --- a/teavm-core/src/main/resources/org/teavm/javascript/runtime.js +++ b/teavm-core/src/main/resources/org/teavm/javascript/runtime.js @@ -250,6 +250,14 @@ function $rt_createByteMultiArray(dimensions) { } return $rt_createMultiArrayImpl($rt_bytecls(), arrays, dimensions); } +function $rt_createCharMultiArray(dimensions) { + var arrays = new Array($rt_primitiveArrayCount(dimensions)); + var firstDim = dimensions[0] | 0; + for (var i = 0 | 0; i < arrays.length; i = (i + 1) | 0) { + arrays[i] = $rt_createCharArray(firstDim); + } + return $rt_createMultiArrayImpl($rt_charcls(), arrays, dimensions); +} function $rt_createBooleanMultiArray(dimensions) { var arrays = new Array($rt_primitiveArrayCount(dimensions)); var firstDim = dimensions[0] | 0;