Syntax
getproto(target: function | integer, index: number | integer, includeInactive?: boolean): function | tableAliases
debug.getprotoArguments
| 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. |
includeInactive? | boolean | When true, inactive nested prototypes may be included when supported. |
Returns
| Name | Type | Description |
|---|---|---|
proto | function | table | Nested prototype or proxy at the requested index. |
Description
Returns a nested prototype from a function by one-based index.
Call it with 3 parameter(s): target, index, includeInactive. The argument table explains which values are required and which ones only refine the behavior.
It returns proto (function | table). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Example call with placeholder values.
local result = getproto(1, 1, true)
print(result)