Closures

sethiddenstack

Marks or unmarks a function, or the function at a stack level, as hidden.

Syntax

sethiddenstack(target: function | number, hidden?: boolean)
Aliases setstackhidden

Arguments

NameTypeDescription
targetfunction | numberFunction or stack level number to mark or unmark.
hidden?booleanWhether the resolved function should be marked hidden. Defaults to true; false removes the mark.

Description

Marks or unmarks a function, or the function at a stack level, as hidden. target must be a function or stack level number. hidden defaults to true. Invalid stack levels raise "Level out of range". setstackhidden is an alias.

Call it with 2 parameter(s): target, hidden. The argument table explains which values are required and which ones only refine the behavior.

It does not return data. Treat the call as an action and handle errors around the call site when needed.

Example

Add or remove a function closure from hidden stack tracking.

local function target()
end

sethiddenstack(target)
print(ishiddenstack(target))

sethiddenstack(target, false)
print(ishiddenstack(target))