MCPcopy Create free account
hub / github.com/RomanKubiak/ctrlr / setfenv

Function setfenv

Source/Misc/lua/src/lua.c:13275–13284  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

ll_moduleFunction · 0.85

Calls 6

lua_getstackFunction · 0.85
lua_getinfoFunction · 0.85
lua_iscfunctionFunction · 0.85
luaL_errorFunction · 0.85
lua_pushvalueFunction · 0.85
lua_setfenvFunction · 0.85

Tested by

no test coverage detected