In Lua 5.2 you can set the uservalue of a userdata to nil
or to a table (Lua 5.3 also allows other values, but this is not supported by the compatibility implementation). Lua 5.1 only allows tables as environments for userdata, and the usual default values for a userdata's environment is the globals table _G
, or the package
table. Therefore, the compatibility implementataion of debug.getuservalue
translates _G
and package
environments to nil
uservalues. The compatibility implementation of debug.setuservalue
for Lua 5.1 does the same and sets the environment of a userdata to _G
if you try to set the uservalue to nil
.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4