MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaL_argerror

Function luaL_argerror

src/Chain/libraries/glua/lauxlib.cpp:180–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 15

checkoptionFunction · 0.85
checktabFunction · 0.85
str_formatFunction · 0.85
getdetailsFunction · 0.85
str_packsizeFunction · 0.85
str_unpackFunction · 0.85
g_readFunction · 0.85
typeerrorFunction · 0.85
luaL_checkoptionFunction · 0.85
luaL_checkanyFunction · 0.85
interrorFunction · 0.85
db_getinfoFunction · 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