| 11005 | |
| 11006 | |
| 11007 | static int luaB_setfenv (lua_State *L) { |
| 11008 | luaL_checktype(L, 2, LUA_TTABLE); |
| 11009 | getfunc(L, 0); |
| 11010 | lua_pushvalue(L, 2); |
| 11011 | if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) { |
| 11012 | /* change environment of current thread */ |
| 11013 | lua_pushthread(L); |
| 11014 | lua_insert(L, -2); |
| 11015 | lua_setfenv(L, -2); |
| 11016 | return 0; |
| 11017 | } |
| 11018 | else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0) |
| 11019 | luaL_error(L, |
| 11020 | LUA_QL("setfenv") " cannot change environment of given object"); |
| 11021 | return 1; |
| 11022 | } |
| 11023 | |
| 11024 | |
| 11025 | static int luaB_rawequal (lua_State *L) { |
nothing calls this directly
no test coverage detected