Lua: fix some subtle Lua-isms

This commit is contained in:
Zef Hemel
2025-03-09 15:37:38 +01:00
parent 29c2781c11
commit 242ae73078
9 changed files with 737 additions and 34 deletions
+6
View File
@@ -195,6 +195,12 @@ export const stringApi = new LuaTable({
}),
sub: new LuaBuiltinFunction((_sf, s: string, i: number, j?: number) => {
j = j ?? s.length;
if (i < 0) {
i = s.length + i + 1;
}
if (j < 0) {
j = s.length + j + 1;
}
return s.slice(i - 1, j);
}),
split: new LuaBuiltinFunction((_sf, s: string, sep: string) => {