MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / traceback

Function traceback

deps/lua/src/lua.c:76–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74
75
76static int traceback (lua_State *L) {
77 if (!lua_isstring(L, 1)) /* 'message' not a string? */
78 return 1; /* keep it intact */
79 lua_getfield(L, LUA_GLOBALSINDEX, "debug");
80 if (!lua_istable(L, -1)) {
81 lua_pop(L, 1);
82 return 1;
83 }
84 lua_getfield(L, -1, "traceback");
85 if (!lua_isfunction(L, -1)) {
86 lua_pop(L, 2);
87 return 1;
88 }
89 lua_pushvalue(L, 1); /* pass error message */
90 lua_pushinteger(L, 2); /* skip this function and traceback */
91 lua_call(L, 2, 1); /* call debug.traceback */
92 return 1;
93}
94
95
96static int docall (lua_State *L, int narg, int clear) {

Callers

nothing calls this directly

Calls 5

lua_isstringFunction · 0.85
lua_getfieldFunction · 0.85
lua_pushvalueFunction · 0.85
lua_pushintegerFunction · 0.85
lua_callFunction · 0.85

Tested by

no test coverage detected