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

Function luaL_getmetafield

third-party/lua-5.2.4/src/lauxlib.c:699–712  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

697
698
699LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
700 if (!lua_getmetatable(L, obj)) /* no metatable? */
701 return 0;
702 lua_pushstring(L, event);
703 lua_rawget(L, -2);
704 if (lua_isnil(L, -1)) {
705 lua_pop(L, 2); /* remove metatable and metafield */
706 return 0;
707 }
708 else {
709 lua_remove(L, -2); /* remove only metatable */
710 return 1;
711 }
712}
713
714
715LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 4

luaB_getmetatableFunction · 0.70
luaB_setmetatableFunction · 0.70
pairsmetaFunction · 0.70
luaL_callmetaFunction · 0.70

Calls 4

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

Tested by

no test coverage detected