debug.getfenv

Returns the environment of an object

Prototype

t = debug.getfenv (obj)

Description

Returns the environment of object obj. This differs a bit from the base function getfenv, which takes a function or a level number, and converts the level number into a function. The debug version simply returns the environment of the argument, which is only meaningful for objects of type function, userdata or thread.

Lua functions

Topics