MCPcopy Create free account
hub / github.com/BigPig0/RelayLive / luaL_argerror

Function luaL_argerror

ThirdParty/lua/lua/lauxlib.c:162–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 13

str_formatFunction · 0.85
getdetailsFunction · 0.85
str_packsizeFunction · 0.85
str_unpackFunction · 0.85
typeerrorFunction · 0.85
luaL_checkoptionFunction · 0.85
luaL_checkanyFunction · 0.85
interrorFunction · 0.85
checkoptionFunction · 0.85
g_readFunction · 0.85
db_getinfoFunction · 0.85
db_getlocalFunction · 0.85

Calls 4

lua_getstackFunction · 0.85
luaL_errorFunction · 0.85
lua_getinfoFunction · 0.85
pushglobalfuncnameFunction · 0.85

Tested by

no test coverage detected