MCPcopy Create free account
hub / github.com/PlutoLang/Pluto / lua_upvalueid

Function lua_upvalueid

src/lapi.cpp:1549–1568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1547
1548
1549LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) {
1550 TValue *fi = index2value(L, fidx);
1551 switch (ttypetag(fi)) {
1552 case LUA_VLCL: { /* lua closure */
1553 return *getupvalref(L, fidx, n, NULL);
1554 }
1555 case LUA_VCCL: { /* C closure */
1556 CClosure *f = clCvalue(fi);
1557 if (1 <= n && n <= f->nupvalues)
1558 return &f->upvalue[n - 1];
1559 /* else */
1560 } /* FALLTHROUGH */
1561 case LUA_VLCF:
1562 return NULL; /* light C functions have no upvalues */
1563 default: {
1564 api_check(L, 0, "function expected");
1565 return NULL;
1566 }
1567 }
1568}
1569
1570
1571LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1,

Callers 1

checkupvalFunction · 0.85

Calls 2

index2valueFunction · 0.85
getupvalrefFunction · 0.85

Tested by

no test coverage detected