AcediaDocumentation

debug.getconstants

Lists a Lua function's constants by their original indices.

Nil constants are omitted, so the returned table can have holes. Use pairs rather than relying on its length.

debug.getconstants(subject: function | number): {any}

Parameters

ParameterTypeDescription
subjectfunction | numberLua function or reachable stack level. C functions are rejected by prototype readers.

Errors: Invalid stack levels or C-function subjects raise errors.

Aliases: getconstants.

On this page