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

Function luaL_argerror

engine/lua/src/lua/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 15

opt_meth_setoptionFunction · 0.85
opt_meth_getoptionFunction · 0.85
opt_set_lingerFunction · 0.85
opt_set_ip_multicast_ifFunction · 0.85
opt_setmembershipFunction · 0.85
opt_ip6_setmembershipFunction · 0.85
luaL_typerrorFunction · 0.85
collect_fdFunction · 0.85
auxiliar_checkclassFunction · 0.85
auxiliar_checkgroupFunction · 0.85
auxiliar_typeerrorFunction · 0.85
LuaSetEulerFunction · 0.85

Calls 3

lua_getstackFunction · 0.85
luaL_errorFunction · 0.85
lua_getinfoFunction · 0.85

Tested by

no test coverage detected