MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / luaL_argerror

Function luaL_argerror

extlibs/lua/src/lauxlib.c:175–190  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

173*/
174
175LUALIB_API int luaL_argerror (lua_State *L, int arg, const char *extramsg) {
176 lua_Debug ar;
177 if (!lua_getstack(L, 0, &ar)) /* no stack frame? */
178 return luaL_error(L, "bad argument #%d (%s)", arg, extramsg);
179 lua_getinfo(L, "n", &ar);
180 if (strcmp(ar.namewhat, "method") == 0) {
181 arg--; /* do not count 'self' */
182 if (arg == 0) /* error is in the self argument itself? */
183 return luaL_error(L, "calling '%s' on bad self (%s)",
184 ar.name, extramsg);
185 }
186 if (ar.name == NULL)
187 ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?";
188 return luaL_error(L, "bad argument #%d to '%s' (%s)",
189 arg, ar.name, extramsg);
190}
191
192
193int luaL_typeerror (lua_State *L, int arg, const char *tname) {

Callers 12

addliteralFunction · 0.85
str_formatFunction · 0.85
getdetailsFunction · 0.85
luaL_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
db_setlocalFunction · 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