Skip to content
Functions & closuresReference

setstackhidden

Represents control of a function's stack visibility.

Details#

Controls whether a function or non-negative stack level is hidden from supported stack views. The second argument is an explicit boolean. Invalid stack levels raise an error; this changes presentation rather than preventing the function from running.

Signature#

Luau
setstackhidden(target: function | number, hidden: boolean): ()

Parameters#

ParameterTypeDescription
targetfunction | numberFunction or non-negative stack level.
hiddenbooleantrue to hide; false to show.

Returns#

No return values. Invalid or negative levels raise an error.

Examples#

Example

Luau
local function helper() return 1 end
setstackhidden(helper, true)
print(helper()) -- 1
setstackhidden(helper, false)