MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / luaL_getmetafield

Function luaL_getmetafield

Source/Misc/lua/src/lua.c:10415–10428  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10413
10414
10415LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
10416if (!lua_getmetatable(L, obj)) /* no metatable? */
10417return 0;
10418lua_pushstring(L, event);
10419lua_rawget(L, -2);
10420if (lua_isnil(L, -1)) {
10421lua_pop(L, 2); /* remove metatable and metafield */
10422return 0;
10423}
10424else {
10425lua_remove(L, -2); /* remove only metatable */
10426return 1;
10427}
10428}
10429
10430
10431LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 4

matchMethod · 0.85
luaL_callmetaFunction · 0.85
luaB_getmetatableFunction · 0.85
luaB_setmetatableFunction · 0.85

Calls 4

lua_getmetatableFunction · 0.85
lua_pushstringFunction · 0.85
lua_rawgetFunction · 0.85
lua_removeFunction · 0.85

Tested by

no test coverage detected