MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / msghandler

Function msghandler

third-party/lua-5.3.5/src/lua.c:179–191  ·  view source on GitHub ↗

** Message handler used to run all chunks */

Source from the content-addressed store, hash-verified

177** Message handler used to run all chunks
178*/
179static int msghandler (lua_State *L) {
180 const char *msg = lua_tostring(L, 1);
181 if (msg == NULL) { /* is error object not a string? */
182 if (luaL_callmeta(L, 1, "__tostring") && /* does it have a metamethod */
183 lua_type(L, -1) == LUA_TSTRING) /* that produces a string? */
184 return 1; /* that is the message */
185 else
186 msg = lua_pushfstring(L, "(error object is a %s value)",
187 luaL_typename(L, 1));
188 }
189 luaL_traceback(L, L, msg, 1); /* append a standard traceback */
190 return 1; /* return the traceback */
191}
192
193
194/*

Callers

nothing calls this directly

Calls 4

luaL_callmetaFunction · 0.70
lua_typeFunction · 0.70
lua_pushfstringFunction · 0.70
luaL_tracebackFunction · 0.70

Tested by

no test coverage detected