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

Function luaL_argerror

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

Source from the content-addressed store, hash-verified

162*/
163
164LUALIB_API int luaL_argerror (lua_State *L, int arg, const char *extramsg) {
165 lua_Debug ar;
166 if (!lua_getstack(L, 0, &ar)) /* no stack frame? */
167 return luaL_error(L, "bad argument #%d (%s)", arg, extramsg);
168 lua_getinfo(L, "n", &ar);
169 if (strcmp(ar.namewhat, "method") == 0) {
170 arg--; /* do not count 'self' */
171 if (arg == 0) /* error is in the self argument itself? */
172 return luaL_error(L, "calling '%s' on bad self (%s)",
173 ar.name, extramsg);
174 }
175 if (ar.name == NULL)
176 ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?";
177 return luaL_error(L, "bad argument #%d to '%s' (%s)",
178 arg, ar.name, extramsg);
179}
180
181
182static int typeerror (lua_State *L, int arg, const char *tname) {

Callers 14

addliteralFunction · 0.70
str_formatFunction · 0.70
getdetailsFunction · 0.70
str_packsizeFunction · 0.70
str_unpackFunction · 0.70
typeerrorFunction · 0.70
luaL_checkoptionFunction · 0.70
luaL_checkanyFunction · 0.70
interrorFunction · 0.70
checkoptionFunction · 0.70
g_readFunction · 0.70
db_getinfoFunction · 0.70

Calls 4

lua_getstackFunction · 0.70
luaL_errorFunction · 0.70
lua_getinfoFunction · 0.70
pushglobalfuncnameFunction · 0.70

Tested by

no test coverage detected