MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / luaL_argerror

Function luaL_argerror

deps/lua/src/lauxlib.c:43–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41
42
43LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) {
44 lua_Debug ar;
45 if (!lua_getstack(L, 0, &ar)) /* no stack frame? */
46 return luaL_error(L, "bad argument #%d (%s)", narg, extramsg);
47 lua_getinfo(L, "n", &ar);
48 if (strcmp(ar.namewhat, "method") == 0) {
49 narg--; /* do not count `self' */
50 if (narg == 0) /* error is in the self argument itself? */
51 return luaL_error(L, "calling " LUA_QS " on bad self (%s)",
52 ar.name, extramsg);
53 }
54 if (ar.name == NULL)
55 ar.name = "?";
56 return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)",
57 narg, ar.name, extramsg);
58}
59
60
61LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) {

Callers 13

getfuncFunction · 0.85
str_formatFunction · 0.85
controloptionsFunction · 0.85
b_sizeFunction · 0.85
luaL_typerrorFunction · 0.85
luaL_checkoptionFunction · 0.85
luaL_checkanyFunction · 0.85
mp_packFunction · 0.85
fileerrorFunction · 0.85
g_readFunction · 0.85
db_getinfoFunction · 0.85
db_getlocalFunction · 0.85

Calls 3

lua_getstackFunction · 0.85
luaL_errorFunction · 0.85
lua_getinfoFunction · 0.85

Tested by

no test coverage detected