MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / auxgetstr

Function auxgetstr

3rd/lua-5.4.3/src/lapi.c:633–647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

631
632
633static int auxgetstr (lua_State *L, const TValue *t, const char *k) {
634 const TValue *slot;
635 TString *str = luaS_new(L, k);
636 if (luaV_fastget(L, t, str, slot, luaH_getstr)) {
637 setobj2s(L, L->top, slot);
638 api_incr_top(L);
639 }
640 else {
641 setsvalue2s(L, L->top, str);
642 api_incr_top(L);
643 luaV_finishget(L, t, s2v(L->top - 1), L->top - 1, slot);
644 }
645 lua_unlock(L);
646 return ttype(s2v(L->top - 1));
647}
648
649
650/*

Callers 2

lua_getglobalFunction · 0.85
lua_getfieldFunction · 0.85

Calls 2

luaS_newFunction · 0.85
luaV_finishgetFunction · 0.85

Tested by

no test coverage detected