| 13273 | |
| 13274 | |
| 13275 | static void setfenv (lua_State *L) { |
| 13276 | lua_Debug ar; |
| 13277 | if (lua_getstack(L, 1, &ar) == 0 || |
| 13278 | lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ |
| 13279 | lua_iscfunction(L, -1)) |
| 13280 | luaL_error(L, LUA_QL("module") " not called from a Lua function"); |
| 13281 | lua_pushvalue(L, -2); |
| 13282 | lua_setfenv(L, -2); |
| 13283 | lua_pop(L, 1); |
| 13284 | } |
| 13285 | |
| 13286 | |
| 13287 | static void dooptions (lua_State *L, int n) { |
no test coverage detected