extract debugging code to internal/debugging module

This commit is contained in:
MihailRis
2025-10-31 23:18:26 +03:00
parent 0e2b203fb2
commit 284f24433c
4 changed files with 157 additions and 157 deletions
+5 -5
View File
@@ -155,18 +155,18 @@ static int l_error_handler(lua_State* L) {
}
int lua::call(State* L, int argc, int nresults) {
int handler_pos = gettop(L) - argc;
int handlerPos = gettop(L) - argc;
pushcfunction(L, l_error_handler);
insert(L, handler_pos);
insert(L, handlerPos);
int top = gettop(L);
if (lua_pcall(L, argc, nresults, handler_pos)) {
if (lua_pcall(L, argc, nresults, handlerPos)) {
std::string log = tostring(L, -1);
pop(L);
remove(L, handler_pos);
remove(L, handlerPos);
throw luaerror(log);
}
int added = gettop(L) - (top - argc - 1);
remove(L, handler_pos);
remove(L, handlerPos);
return added;
}