extract debugging code to internal/debugging module
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user