Debug

setconstant

用基于 1 的索引替换函数或原型中的常量。

语法

setconstant(target: function | integer, index: number | integer, value: any)
别名 debug.setconstant

参数

名称类型描述
targetfunction | integer要检查的函数、堆栈级别或原型。
indexnumber | integer常量、原型、上值或堆栈槽内基于一的索引。
valueany要写入的新值。

说明

用基于 1 的索引替换函数或原型中的常量。

使用 3 个参数调用: target, index, value。参数表会说明哪些值必填,哪些值只用于细化行为。

不返回数据。将调用视为一个动作,并在调用点附近处理错误。

示例

使用占位值的示例调用。

setconstant(1, 1, nil)