语法
getproto(target: function | integer, index: number | integer, includeInactive?: boolean): function | table别名
debug.getproto参数
| 名称 | 类型 | 描述 |
|---|---|---|
target | function | integer | 要检查的函数、堆栈级别或原型。 |
index | number | integer | 常量、原型、上值或堆栈槽内基于一的索引。 |
includeInactive? | boolean | 如果为 true,则在支持时可以包含非活动嵌套原型。 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
proto | function | table | 在请求的索引处嵌套原型或代理。 |
说明
按从一开始的索引从函数返回嵌套原型。
使用 3 个参数调用: target, index, includeInactive。参数表会说明哪些值必填,哪些值只用于细化行为。
返回 proto (function | table)。使用返回表区分成功值、nil 结果和可恢复错误。
示例
使用占位值的示例调用。
local result = getproto(1, 1, true)
print(result)