debug.upvalueid (f, n)
Returns a unique identifier (as a light userdata) for the upvalue numbered n
from the given function.
These unique identifiers allow a program to check whether different closures share upvalues. Lua closures that share an upvalue (that is, that access a same external local variable) will return identical ids for those upvalue indices.
Please login to continue.