Syntax
setupvalue(target: function | integer, index: number | integer, value: any)Aliases
debug.setupvalueArguments
| Name | Type | Description |
|---|---|---|
target | function | integer | Function, stack level, or prototype to inspect. |
index | number | integer | One-based index inside constants, protos, upvalues, or stack slots. |
value | any | New value to write. |
Description
Replaces an upvalue in a function by one-based index.
Call it with 3 parameter(s): target, index, value. The argument table explains which values are required and which ones only refine the behavior.
It does not return data. Treat the call as an action and handle errors around the call site when needed.
Example
Example call with placeholder values.
setupvalue(1, 1, nil)