sUNC Reference
Closures
Inspect, create, classify, hook and restore Luau closures.
Related to sUNC documentation
This reference is based exclusively on the official sUNC documentation.
Overview
- Closure APIs compile source, identify closure types and replace callable behavior.
- Only functions covered by the official sUNC reference are listed here.
Available functions
checkcallerReports whether the current function was invoked from the executor thread.clonefunctionCreates an independent function with the same behavior and environment.getfunctionhashHashes the instructions and constants of a Luau function.hookfunctionReplaces a function with a hook.hookmetamethodHooks a named metamethod on a metatable-capable object.iscclosureChecks whether a function is a C closure.isexecutorclosureChecks whether a closure belongs to the executor.islclosureChecks whether a function is a Luau closure.loadstringCompiles source into a runnable function.newcclosureWraps a Luau function as a yieldable C closure.restorefunctionRestores a hooked function to its original implementation.