func into a C function.
iscclosure, isnewcclosure, and isexecutorclosure all return true on it. Already-
newcclosure-wrapped functions are accepted too - each call adds another wrapper layer.
Most commonly used to disguise your Luau code as a built-in C function - so it passes iscclosure checks instead of failing them.
Parameters
Returns
function - a wrapper around func. When called, it runs the same body, but the wrapper itself reports as C.Every call to
newcclosure produces a new closure: newcclosure(f) ~= newcclosure(f).
The wrapper preserves identity context - both getthreadidentity and checkcaller inside the body see the same values they would outside.