Yuari
Documentation
Docs/Debug/debug.setinfo

debug.setinfo

Updates a function debug name, source and linedefined from a table.

Syntax

debug.setinfo(fnOrLevel: function | number, info: any) -> nil

Parameters

ParameterTypeDescription
fnOrLevelfunction | numberThe fn or level value used by the call.
infoanyThe info value used by the call.

Returns

TypeDescription
nilThis function does not return a value.

Description

debug.setinfo is part of the Debug library. The debug library exposes the internals of the active Luau state, including protos, constants, upvalues and stack frames.

The change is applied directly to the live target, so later reads observe the updated value.

Example

local fn = function() end
debug.setinfo(fn, { name = "Custom", source = "@custom", linedefined = 10 })

Notes

  • Writing protos, constants or upvalues can corrupt a running function; test changes carefully.