MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / auxupvalue

Function auxupvalue

third-party/lua-5.3.5/src/ldblib.c:248–257  ·  view source on GitHub ↗

** get (if 'get' is true) or set an upvalue from a closure */

Source from the content-addressed store, hash-verified

246** get (if 'get' is true) or set an upvalue from a closure
247*/
248static int auxupvalue (lua_State *L, int get) {
249 const char *name;
250 int n = (int)luaL_checkinteger(L, 2); /* upvalue index */
251 luaL_checktype(L, 1, LUA_TFUNCTION); /* closure */
252 name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n);
253 if (name == NULL) return 0;
254 lua_pushstring(L, name);
255 lua_insert(L, -(get+1)); /* no-op if get is false */
256 return get + 1;
257}
258
259
260static int db_getupvalue (lua_State *L) {

Callers 2

db_getupvalueFunction · 0.70
db_setupvalueFunction · 0.70

Calls 6

luaL_checkintegerFunction · 0.70
luaL_checktypeFunction · 0.70
lua_getupvalueFunction · 0.70
lua_setupvalueFunction · 0.70
lua_pushstringFunction · 0.70
lua_insertFunction · 0.50

Tested by

no test coverage detected