MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / setfenv

Function setfenv

lua/loadlib.c:512–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

510
511
512static void setfenv (lua_State *L) {
513 lua_Debug ar;
514 if (lua_getstack(L, 1, &ar) == 0 ||
515 lua_getinfo(L, "f", &ar) == 0 || /* get calling function */
516 lua_iscfunction(L, -1))
517 luaL_error(L, LUA_QL("module") " not called from a Lua function");
518 lua_pushvalue(L, -2);
519 lua_setfenv(L, -2);
520 lua_pop(L, 1);
521}
522
523
524static 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