Returns an array of every child prototype of target, in compiler order.
Every function on this page is reachable both as debug.<name> and as a plain global of the same name, so debug.getupvalues(f) and getupvalues(f) are the same call.

Parameters

function | number
required
The function to inspect, or a stack level. Level 1 is your caller.
boolean
default:"false"
When true, each entry is a freshly built closure over the prototype rather than an inert handle.

Returns

table
An array of prototype handles.

Behavior

  • The array is dense and ordered. Entry i is the same prototype getproto(target, i) returns.
  • A function with no inner functions returns an empty table, not an error.

Example

Errors