MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / luaL_getmetafield

Function luaL_getmetafield

third-party/lua-5.4.6/src/lauxlib.c:860–873  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

858
859
860LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
861 if (!lua_getmetatable(L, obj)) /* no metatable? */
862 return LUA_TNIL;
863 else {
864 int tt;
865 lua_pushstring(L, event);
866 tt = lua_rawget(L, -2);
867 if (tt == LUA_TNIL) /* is metafield nil? */
868 lua_pop(L, 2); /* remove metatable and metafield */
869 else
870 lua_remove(L, -2); /* remove only metatable */
871 return tt; /* return metafield type */
872 }
873}
874
875
876LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 7

luaB_getmetatableFunction · 0.70
luaB_setmetatableFunction · 0.70
luaB_pairsFunction · 0.70
trymtFunction · 0.70
luaL_typeerrorFunction · 0.70
luaL_callmetaFunction · 0.70
luaL_tolstringFunction · 0.70

Calls 4

lua_getmetatableFunction · 0.70
lua_pushstringFunction · 0.70
lua_rawgetFunction · 0.70
lua_removeFunction · 0.50

Tested by

no test coverage detected