islclosure
islclosure checks whether a given function is a Luau closure or not.
function islclosure(func: (...any) -> (...any)): boolean
Parameters
| Parameter |
Description |
func |
The function to check. |
Example
| Verifying Luau closures with islclosure |
|---|
| local function dummy_lua_function()
print("This is an executor Luau closure")
end
local dummy_cfunction = newcclosure(function()
print("This is an executor C closure")
end)
local dummy_standard_cfunction = print
print(islclosure(dummy_lua_function)) -- Output: true
print(islclosure(dummy_standard_cfunction)) -- Output: false
print(islclosure(dummy_cfunction)) -- Output: false
|