| 141 | |
| 142 | |
| 143 | static int luaB_setfenv (lua_State *L) { |
| 144 | luaL_checktype(L, 2, LUA_TTABLE); |
| 145 | getfunc(L, 0); |
| 146 | lua_pushvalue(L, 2); |
| 147 | if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) { |
| 148 | /* change environment of current thread */ |
| 149 | lua_pushthread(L); |
| 150 | lua_insert(L, -2); |
| 151 | lua_setfenv(L, -2); |
| 152 | return 0; |
| 153 | } |
| 154 | else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0) |
| 155 | luaL_error(L, |
| 156 | LUA_QL("setfenv") " cannot change environment of given object"); |
| 157 | return 1; |
| 158 | } |
| 159 | |
| 160 | |
| 161 | static int luaB_rawequal (lua_State *L) { |
nothing calls this directly
no test coverage detected