| 110 | |
| 111 | |
| 112 | static int luaB_setmetatable (lua_State *L) { |
| 113 | int t = lua_type(L, 2); |
| 114 | luaL_checktype(L, 1, LUA_TTABLE); |
| 115 | luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, |
| 116 | "nil or table expected"); |
| 117 | if (luaL_getmetafield(L, 1, "__metatable")) |
| 118 | return luaL_error(L, "cannot change a protected metatable"); |
| 119 | lua_settop(L, 2); |
| 120 | lua_setmetatable(L, 1); |
| 121 | return 1; |
| 122 | } |
| 123 | |
| 124 | |
| 125 | static int luaB_rawequal (lua_State *L) { |
nothing calls this directly
no test coverage detected