fix: report proper function name in String.length errors

This commit is contained in:
TopchetoEU 2024-01-06 17:47:07 +02:00
parent 4aa757e625
commit 2c634778c3
Signed by: topchetoeu
GPG Key ID: 6531B8583E5F6ED4

View File

@ -37,14 +37,14 @@ public class StringLib {
if (i < 0) i += len; if (i < 0) i += len;
if (clamp) { if (clamp) {
if (i < 0) i = 0; if (i < 0) i = 0;
if (i >= len) i = len; if (i > len) i = len;
} }
return i; return i;
} }
@Expose(type = ExposeType.GETTER) @Expose(type = ExposeType.GETTER)
public static int __length(Arguments args) { public static int __length(Arguments args) {
return passThis(args, "substring").length(); return passThis(args, "length").length();
} }
@Expose public static String __substring(Arguments args) { @Expose public static String __substring(Arguments args) {