Skip to content
Philipp Janda edited this page Mar 16, 2015 · 1 revision

lua_getuservalue

The compatibility implementation of lua_getuservalue is just a thin macro over the native implementations of the older Lua versions (lua_getfenv for Lua 5.1, and lua_getuservalue for Lua 5.2). As a consequence, lua_getuservalue might return the default environment tables for userdata in Lua 5.1 (_G or package) when no explicit environment has been set (Lua 5.2 and 5.3 would return nil in such a case).

See also lua_setuservalue.

Clone this wiki locally