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

Function luaL_getmetafield

third-party/lua-5.3.5/src/lauxlib.c:772–785  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

770
771
772LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
773 if (!lua_getmetatable(L, obj)) /* no metatable? */
774 return LUA_TNIL;
775 else {
776 int tt;
777 lua_pushstring(L, event);
778 tt = lua_rawget(L, -2);
779 if (tt == LUA_TNIL) /* is metafield nil? */
780 lua_pop(L, 2); /* remove metatable and metafield */
781 else
782 lua_remove(L, -2); /* remove only metatable */
783 return tt; /* return metafield type */
784 }
785}
786
787
788LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 6

luaB_getmetatableFunction · 0.70
luaB_setmetatableFunction · 0.70
pairsmetaFunction · 0.70
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