debug.setfenv

Sets the environment of an object

Prototype

obj = debug.setfenv (object, table)

Description

Sets the environment of the given object to the given table. Returns object. Similarly to debug.getfenv, this function takes a raw object (unlike the base setfenv function which can also take a function level).

Lua functions

Topics