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