MCPcopy Create free account
hub / github.com/SakuraEngine/SakuraEngine / msghandler

Function msghandler

xrepo/packages/l/lua/port/lua/src/lua.c:134–146  ·  view source on GitHub ↗

** Message handler used to run all chunks */

Source from the content-addressed store, hash-verified

132** Message handler used to run all chunks
133*/
134static int msghandler (lua_State *L) {
135 const char *msg = lua_tostring(L, 1);
136 if (msg == NULL) { /* is error object not a string? */
137 if (luaL_callmeta(L, 1, "__tostring") && /* does it have a metamethod */
138 lua_type(L, -1) == LUA_TSTRING) /* that produces a string? */
139 return 1; /* that is the message */
140 else
141 msg = lua_pushfstring(L, "(error object is a %s value)",
142 luaL_typename(L, 1));
143 }
144 luaL_traceback(L, L, msg, 1); /* append a standard traceback */
145 return 1; /* return the traceback */
146}
147
148
149/*

Callers

nothing calls this directly

Calls 5

lua_pushfstringFunction · 0.85
luaL_typenameFunction · 0.85
luaL_tracebackFunction · 0.85
luaL_callmetaFunction · 0.70
lua_typeFunction · 0.70

Tested by

no test coverage detected