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
| Function | Description |
|---|---|
checkcaller | Returns whether the current call originated from executor-owned code. |
clonefunction | Creates a callable clone of a function while preserving its behavior. |
comparefunctions | Checks whether two function references point to the same underlying closure. |
getfunctionhash | Returns a hash representing a function bytecode body when available. |
hookfunction | Replaces a target function with a replacement and returns the original function. |
hookmetamethod | Hooks a metamethod on a table or object by installing a replacement function. |
iscclosure | Returns whether a function is a native C closure. |
isexecutorclosure | Returns whether a function was created by the executor. |
isfunctionhooked | Returns whether a function has been hooked through the executor hook system. |
ishiddenstack | Checks whether a function or stack level is hidden from stack inspection. |
islclosure | Returns whether a function is a Luau closure. |
isnewcclosure | Returns whether a function was created by newcclosure. |
newcclosure | Wraps a Luau function as an executor-created C closure. |
newlclosure | Creates an executor-owned Luau closure from a function. |
restorefunction | Restores a previously hooked function, optionally using a provided original function. |
sethiddenstack | Changes whether a function or stack level is hidden from stack inspection. |