MCPcopy Create free account
hub / github.com/TypesettingTools/Aegisub / argerror

Function argerror

libaegisub/lua/utils.cpp:194–204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192}
193
194[[noreturn]] int argerror(lua_State *L, int narg, const char *extramsg) {
195 lua_Debug ar;
196 if (!lua_getstack(L, 0, &ar))
197 error(L, "bad argument #%d (%s)", narg, extramsg);
198 lua_getinfo(L, "n", &ar);
199 if (strcmp(ar.namewhat, "method") == 0 && --narg == 0)
200 error(L, "calling '%s' on bad self (%s)", ar.name, extramsg);
201 if (!ar.name) ar.name = "?";
202 error(L, "bad argument #%d to '%s' (%s)",
203 narg, ar.name, extramsg);
204}
205
206[[noreturn]] int typerror(lua_State *L, int narg, const char *tname) {
207 const char *msg = lua_pushfstring(L, "%s expected, got %s",

Callers 3

check_uintFunction · 0.85
typerrorFunction · 0.85
argcheckFunction · 0.85

Calls 1

errorFunction · 0.85

Tested by

no test coverage detected