MCPcopy Create free account
hub / github.com/axmolengine/axmol / luaL_typeerror

Function luaL_typeerror

3rdparty/lua/plainlua/lauxlib.c:194–205  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

192
193
194LUALIB_API int luaL_typeerror (lua_State *L, int arg, const char *tname) {
195 const char *msg;
196 const char *typearg; /* name for the type of the actual argument */
197 if (luaL_getmetafield(L, arg, "__name") == LUA_TSTRING)
198 typearg = lua_tostring(L, -1); /* use the given type name */
199 else if (lua_type(L, arg) == LUA_TLIGHTUSERDATA)
200 typearg = "light userdata"; /* special name for messages */
201 else
202 typearg = luaL_typename(L, arg); /* standard name */
203 msg = lua_pushfstring(L, "%s expected, got %s", tname, typearg);
204 return luaL_argerror(L, arg, msg);
205}
206
207
208static void tag_error (lua_State *L, int arg, int tag) {

Callers 1

tag_errorFunction · 0.85

Calls 4

luaL_getmetafieldFunction · 0.85
lua_typeFunction · 0.85
lua_pushfstringFunction · 0.85
luaL_argerrorFunction · 0.85

Tested by

no test coverage detected