文档加载中…
debug.getinfo
返回函数或栈层级的相关信息。
debug.getinfo(f: function | number, options?: string) -> table
f
function | number
options
string?
table
debug.getinfo 返回描述给定函数或栈帧的表。常见字段包括 source(来源)、name(名称)、linedefined(定义行号)和 what(类型)。
source
name
linedefined
what
local info = debug.getinfo(print) print(info.name, info.what) -- 输出 print C