MCPcopy Create free account
hub / github.com/Tencent/xLua / lua_setfenv

Function lua_setfenv

WebGLPlugins/xlua.c:100–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

98
99#if LUA_VERSION_NUM ==503
100LUA_API int lua_setfenv(lua_State *L, int idx)
101{
102 int type = lua_type(L, idx);
103 if(type == LUA_TUSERDATA || type == LUA_TFUNCTION)
104 {
105 lua_setupvalue(L, idx, 1);
106 return 1;
107 }
108 else
109 {
110 return 0;
111 }
112}
113
114LUA_API uint32_t xlua_objlen (lua_State *L, int idx) {
115 return (uint32_t)lua_rawlen (L, idx);

Callers

nothing calls this directly

Calls 2

lua_typeFunction · 0.85
lua_setupvalueFunction · 0.85

Tested by

no test coverage detected