| 124 | |
| 125 | |
| 126 | static int luaB_getmetatable (lua_State *L) { |
| 127 | luaL_checkany(L, 1); |
| 128 | if (!lua_getmetatable(L, 1)) { |
| 129 | lua_pushnil(L); |
| 130 | return 1; /* no metatable */ |
| 131 | } |
| 132 | luaL_getmetafield(L, 1, "__metatable"); |
| 133 | return 1; /* returns either __metatable field (if present) or metatable */ |
| 134 | } |
| 135 | |
| 136 | |
| 137 | static int luaB_setmetatable (lua_State *L) { |
nothing calls this directly
no test coverage detected