fix: luau does not export a luaL_errorL, write our own

This commit is contained in:
Erica Marigold 2025-04-26 07:49:28 +01:00
parent 342c56b4da
commit 08e1de819f
Signed by: DevComp
SSH key fingerprint: SHA256:jD3oMT4WL3WHPJQbrjC3l5feNCnkv7ndW8nYaHX5wFw
2 changed files with 4 additions and 7 deletions

View file

@ -13,11 +13,6 @@ lua_State* clua_newstate(void* f, void* ud)
return lua_newstate((lua_Alloc)f, ud);
}
l_noret cluaL_errorL(lua_State* L, char* msg)
{
luaL_errorL(L, msg);
}
void clua_pushcclosurek(lua_State* L, void* f, char* debugname, int nup, void* cont) {
return lua_pushcclosurek(L, (lua_CFunction)f, debugname, nup, (lua_Continuation)cont);
}

View file

@ -171,8 +171,10 @@ func LErrorL(L *LuaState, msg string) {
cmsg := C.CString(msg)
defer C.free(unsafe.Pointer(cmsg))
C.cluaL_errorL(L, cmsg)
panic(msg)
PushString(L, msg)
Error(L)
// TODO: do we panic on the go side?
}
func LCheckOption(L *LuaState, narg int32, def string, lst []string) int32 {