pub fn lua_getupvalue(l: LuaState, fidx: c_int, idx: c_int) -> LuaString
Expand description
Gets information about a closure’s upvalue. This is basically debug.getlocal. (For Lua functions, upvalues are the external local variables that the function uses, and that are consequently included in its closure.)
§Parameters
idx
- Index of the upvalue to push the value of onto the stack and return the name of (like debug.getlocal)fidx
- Points to the closure in the stack.
§Note
Upvalues have no particular order, as they are active through the whole function. So, they are numbered in an arbitrary order.
§Returns
The name of the upvalue at given index idx
, or NULL (and pushes nothing) if the index is greater than the number of upvalues.
For C functions (functions not created in lua), this returns an empty string for the name of all upvalues