Yuari
Documentation
Docs/Closures/isnewcclosure

isnewcclosure

Returns true for closures created by newcclosure or newlclosure wrappers.

Syntax

isnewcclosure(fn: function) -> boolean

Parameters

ParameterTypeDescription
fnfunctionThe function or callback to use.

Returns

TypeDescription
booleanTrue for closures created by newcclosure or newlclosure wrappers

Description

isnewcclosure is part of the Closures library. Closure helpers operate on live Luau function objects. Hooks redirect future calls through the replacement closure and return the previous implementation.

The call is a predicate: it inspects the current state and returns a boolean without modifying anything.

The aliases iscustomcclosure(fn) resolve to the same implementation.

Example

print(isnewcclosure(newcclosure(function() end)), isnewcclosure(function() end))

Notes

  • Aliases: iscustomcclosure(fn).
  • Closure operations act on live Luau function objects; installed hooks remain active until restored.