Debug

getprotos

Returns all nested prototypes found in a function.

Syntax

getprotos(target: function | integer): table
Aliases debug.getprotos

Arguments

NameTypeDescription
targetfunction | integerFunction, stack level, or prototype to inspect.

Returns

NameTypeDescription
protostableArray table of nested prototypes.

Description

Returns all nested prototypes found in a function.

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

It returns protos (table). Use the returns table to separate successful values from nil results and recoverable errors.

Example

Example call with placeholder values.

local result = getprotos(1)
print(result)