Forces a stack trace and returns the string
| 2064 | |
| 2065 | // Forces a stack trace and returns the string |
| 2066 | static const char *CallLuaTraceback(lua_State *L) { |
| 2067 | lua_getfield(L, LUA_GLOBALSINDEX, "debug"); |
| 2068 | if (!lua_istable(L, -1)) { |
| 2069 | lua_pop(L, 1); |
| 2070 | return ""; |
| 2071 | } |
| 2072 | |
| 2073 | lua_getfield(L, -1, "traceback"); |
| 2074 | if (!lua_isfunction(L, -1)) { |
| 2075 | lua_pop(L, 2); |
| 2076 | return ""; |
| 2077 | } |
| 2078 | |
| 2079 | lua_pushvalue(L, 1); |
| 2080 | lua_call(L, 1, 1); |
| 2081 | |
| 2082 | return lua_tostring(L, -1); |
| 2083 | } |
| 2084 | |
| 2085 | |
| 2086 | void HandleCallbackError(lua_State* L) |
no test coverage detected