debug.getconstant
Reads one Lua constant by its index.
Constant indices start at 1 and refer to the compiler's constant array, not source-code order.
debug.getconstant(subject: function | number, index: number): anyParameters
| Parameter | Type | Description |
|---|---|---|
subject | function | number | Lua function or reachable stack level. C functions are rejected by prototype readers. |
index | number | One-based constant or upvalue index. |
Errors: An out-of-range index raises an error.
Aliases: getconstant.
