MCPcopy Create free account
hub / github.com/defold/defold / luaL_getmetafield

Function luaL_getmetafield

engine/lua/src/lua/lauxlib.c:203–216  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201
202
203LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) {
204 if (!lua_getmetatable(L, obj)) /* no metatable? */
205 return 0;
206 lua_pushstring(L, event);
207 lua_rawget(L, -2);
208 if (lua_isnil(L, -1)) {
209 lua_pop(L, 2); /* remove metatable and metafield */
210 return 0;
211 }
212 else {
213 lua_remove(L, -2); /* remove only metatable */
214 return 1;
215 }
216}
217
218
219LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) {

Callers 3

luaB_getmetatableFunction · 0.85
luaB_setmetatableFunction · 0.85
luaL_callmetaFunction · 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