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

Function luaB_setfenv

Source/Misc/lua/src/lua.c:11007–11022  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 10

luaL_checktypeFunction · 0.85
getfuncFunction · 0.85
lua_pushvalueFunction · 0.85
lua_isnumberFunction · 0.85
lua_tonumberFunction · 0.85
lua_pushthreadFunction · 0.85
lua_insertFunction · 0.85
lua_setfenvFunction · 0.85
lua_iscfunctionFunction · 0.85
luaL_errorFunction · 0.85

Tested by

no test coverage detected