Skip to content
Functions & closuresReference

isnewcclosure

Identifies wrappers created by the module.

Details#

Checks whether a function is one of the module's newcclosure wrappers. An arbitrary C closure is not necessarily such a wrapper.

Signature#

Luau
isnewcclosure(target: function): boolean

Parameters#

ParameterTypeDescription
targetfunctionThe exact function value to inspect or modify.

Returns#

A boolean result; non-function arguments raise a type error.

Examples#

Example

Luau
local f = newcclosure(function() return 1 end)
print(isnewcclosure(f)) -- true