| 92 | |
| 93 | |
| 94 | static int luaB_setmetatable (lua_State *L) { |
| 95 | int t = lua_type(L, 2); |
| 96 | luaL_checktype(L, 1, LUA_TTABLE); |
| 97 | luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, |
| 98 | "nil or table expected"); |
| 99 | if (luaL_getmetafield(L, 1, "__metatable")) |
| 100 | return luaL_error(L, "cannot change a protected metatable"); |
| 101 | lua_settop(L, 2); |
| 102 | lua_setmetatable(L, 1); |
| 103 | return 1; |
| 104 | } |
| 105 | |
| 106 | |
| 107 | static int luaB_rawequal (lua_State *L) { |
nothing calls this directly
no test coverage detected