From c52b71292d772adb5965ccd3f93cbfaf0903679e Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Fri, 11 Nov 2022 09:15:52 +0100 Subject: [PATCH] Fix Math.pow implementation in JS --- .../org/teavm/classlib/java/lang/MathNativeGenerator.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classlib/src/main/java/org/teavm/classlib/java/lang/MathNativeGenerator.java b/classlib/src/main/java/org/teavm/classlib/java/lang/MathNativeGenerator.java index 90a77e5bc..50628e33d 100644 --- a/classlib/src/main/java/org/teavm/classlib/java/lang/MathNativeGenerator.java +++ b/classlib/src/main/java/org/teavm/classlib/java/lang/MathNativeGenerator.java @@ -25,8 +25,8 @@ public class MathNativeGenerator implements Generator { @Override public void generate(GeneratorContext context, SourceWriter writer, MethodReference methodRef) throws IOException { String name = methodRef.getName(); - if (name.equals("randomImpl")) { - name = "random"; + if (name.endsWith("Impl")) { + name = name.substring(0, name.length() - 4); } function(context, writer, "Math." + name, methodRef.parameterCount()); }