debug.setfenv (object, table)

Sets the environment of the given object to the given table. Returns object.