Include variables in redbean lua traceback

This commit is contained in:
Justine Tunney 2022-04-16 12:45:10 -07:00
parent be7c5e1071
commit 933f33bcc1
4 changed files with 59 additions and 13 deletions

View file

@ -50,7 +50,7 @@ int LuaCallWithTrace(lua_State *L, int nargs, int nres, lua_State *C) {
// move the error message
lua_xmove(C, L, 1);
// replace the error with the traceback on failure
luaL_traceback(L, C, lua_tostring(L, -1), 0);
luaL_traceback2(L, C, lua_tostring(L, -1), 0);
lua_remove(L, -2); // remove the error message
} else {
if (!lua_checkstack(L, MAX(nresults, nres))) {