MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / luaL_getmetafield

Function luaL_getmetafield

src/Chain/libraries/glua/lauxlib.cpp:2406–2419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2404
2405
2406LUALIB_API int luaL_getmetafield(lua_State *L, int obj, const char *event) {
2407 if (!lua_getmetatable(L, obj)) /* no metatable? */
2408 return LUA_TNIL;
2409 else {
2410 int tt;
2411 lua_pushstring(L, event);
2412 tt = lua_rawget(L, -2);
2413 if (tt == LUA_TNIL) /* is metafield nil? */
2414 lua_pop(L, 2); /* remove metatable and metafield */
2415 else
2416 lua_remove(L, -2); /* remove only metatable */
2417 return tt; /* return metafield type */
2418 }
2419}
2420
2421
2422LUALIB_API int luaL_callmeta(lua_State *L, int obj, const char *event) {

Callers 5

typeerrorFunction · 0.85
luaL_callmetaFunction · 0.85
luaB_getmetatableFunction · 0.85
luaB_setmetatableFunction · 0.85
pairsmetaFunction · 0.85

Calls 3

lua_getmetatableFunction · 0.85
lua_pushstringFunction · 0.85
lua_rawgetFunction · 0.85

Tested by

no test coverage detected