Debug libraryOverview
debug.getconstant
Represents inspection of a function constant.
Aliases
getconstantDetails#
Reads a constant at a one-based pool index. Unsupported constant types yield nil; an empty pool or out-of-range index raises an error. Determine the index from getconstants rather than assuming source order.
Examples#
Example
local f = assert(loadstring("return 'docs constant'"))
for index in pairs(debug.getconstants(f)) do
print(debug.getconstant(f, index))
end