some more changes

This commit is contained in:
2026-02-16 13:57:43 +01:00
parent d97b3f0413
commit 9b6cb0af7c
6 changed files with 163 additions and 30 deletions

View File

@@ -59,7 +59,10 @@ static nn_Exit luaArch_luaToNN(luaArch *arch, lua_State *L, int luaIdx) {
if(lua_isnoneornil(L, luaIdx)) {
return nn_pushnull(C);
}
if(lua_isnumber(L, luaIdx)) {
// lua_isnumber() automatically casts
// because the Lua C API designers
// were high
if(lua_type(L, luaIdx) == LUA_TNUMBER) {
return nn_pushnumber(C, lua_tonumber(L, luaIdx));
}
if(lua_isstring(L, luaIdx)) {