minetest-mods / irc

IRC Mod for Minetest
BSD 2-Clause "Simplified" License
43 stars 31 forks source link

lua_api says to store the insecure environment in a local variable #63

Closed Poikilos closed 4 years ago

Poikilos commented 4 years ago

https://github.com/minetest/minetest/blob/master/doc/lua_api.txt#L5355 says to store the insecure environment "IN A LOCAL VARIABLE" (and says so in all caps). However, it also says that it must be obtained in a global scope.

  1. Is the mod supposed to pass ie around to itself but set the global version of the variable to nil
  2. There is nothing more globally accessible than how the irc mod uses the ie variable currently, so it is inadvisable to keep it that way, right, or does the local declaration actually protect it even in the current scope?
Poikilos commented 4 years ago

It seems protected by local so I'll close this. You can reopen it if it is an actual issue.