Closures

restorefunction

Restores a previously hooked function, optionally using a provided original function.

Syntax

restorefunction(target: function, original?: function)
Aliases restorefuncrestoreclosure

Arguments

NameTypeDescription
targetfunctionTarget function, table, stack level, or object being inspected or changed.
original?functionOriginal function returned by a previous hook operation.

Description

Restores a previously hooked function, optionally using a provided original function.

Call it with 2 parameter(s): target, original. The argument table explains which values are required and which ones only refine the behavior.

It does not return data. Treat the call as an action and handle errors around the call site when needed.

Example

Example call with placeholder values.

restorefunction(function() end, function() end)