debug.getprotos
C closures are not supported
This function will throw an error if called on a C closure, such as print
, since C closures do not contain function prototypes.
Inactive protos
Protos retrieved without the activated
should not be callable; this leads to vulnerabilities.
The usage of inactive protos is to retrieve information off of them.
debug.getprotos
returns all function prototypes defined within the specified Luau function.
These are internal function definitions (e.g. nested functions) that exist as part of the compiled bytecode, even if they aren't assigned or called.
Parameters
Parameter | Description |
---|---|
func |
The Lua function (or stack level) to extract protos from. |
Example
Getting nested function prototypes | |
---|---|