| 235 | |
| 236 | |
| 237 | static int luaB_setmetatable(lua_State *L) { |
| 238 | int t = lua_type(L, 2); |
| 239 | luaL_checktype(L, 1, LUA_TTABLE); |
| 240 | luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, |
| 241 | "nil or table expected"); |
| 242 | if (luaL_getmetafield(L, 1, "__metatable") != LUA_TNIL) |
| 243 | return luaL_error(L, "cannot change a protected metatable"); |
| 244 | lua_settop(L, 2); |
| 245 | lua_setmetatable(L, 1); |
| 246 | return 1; |
| 247 | } |
| 248 | |
| 249 | |
| 250 | static int luaB_rawequal(lua_State *L) { |
nothing calls this directly
no test coverage detected