Category

Closures

Inspect, create, clone, and replace closures.

Category guide

Overview

Use this overview to understand the category before opening a specific function.
  • See what this group of functions is meant to solve.
  • Compare function names and descriptions in one table.
  • Open a function for syntax, arguments, returns, and examples.

Closures

Available functions

16 functions
FunctionDescription
checkcallerReturns whether the current call originated from executor-owned code.
clonefunctionCreates a callable clone of a function while preserving its behavior.
comparefunctionsChecks whether two function references point to the same underlying closure.
getfunctionhashReturns a hash representing a function bytecode body when available.
hookfunctionReplaces a target function with a replacement and returns the original function.
hookmetamethodHooks a metamethod on a table or object by installing a replacement function.
iscclosureReturns whether a function is a native C closure.
isexecutorclosureReturns whether a function was created by the executor.
isfunctionhookedReturns whether a function has been hooked through the executor hook system.
ishiddenstackChecks whether a function or stack level is hidden from stack inspection.
islclosureReturns whether a function is a Luau closure.
isnewcclosureReturns whether a function was created by newcclosure.
newcclosureWraps a Luau function as an executor-created C closure.
newlclosureCreates an executor-owned Luau closure from a function.
restorefunctionRestores a previously hooked function, optionally using a provided original function.
sethiddenstackChanges whether a function or stack level is hidden from stack inspection.