MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / setfenv

Function setfenv

other_src/lua/src/loadlib.cpp:522–531  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

520
521
522static void setfenv (lua_State *L) {
523 lua_Debug ar;
524 if (lua_getstack(L, 1, &ar) == 0 ||
525 lua_getinfo(L, "f", &ar) == 0 || /* get calling function */
526 lua_iscfunction(L, -1))
527 luaL_error(L, LUA_QL("module") " not called from a Lua function");
528 lua_pushvalue(L, -2);
529 lua_setfenv(L, -2);
530 lua_pop(L, 1);
531}
532
533
534static void dooptions (lua_State *L, int n) {

Callers 1

ll_moduleFunction · 0.70

Calls 6

lua_getstackFunction · 0.70
lua_getinfoFunction · 0.70
lua_iscfunctionFunction · 0.70
luaL_errorFunction · 0.70
lua_pushvalueFunction · 0.70
lua_setfenvFunction · 0.70

Tested by

no test coverage detected