isnewcclosure Synchronous

  • iscustomcclosure

Identify a wrapper created by newcclosure. It is narrower than iscclosure: an ordinary native C function is not necessarily one of these wrappers.

Syntax
Luau
isnewcclosure(value: Function) -> boolean

Parameters

Function parameters
ParameterTypeDescription
valueFunctionThe function to inspect. Passing a non-function raises an error.

Returns

boolean

true for a newcclosure wrapper; false for other functions.

Example

Example
Luau
local wrapped = newcclosure(function(value) return value end)
print(isnewcclosure(wrapped)) -- true
print(iscclosure(wrapped)) -- true
Kawaii documentation