Closed AndreasMatthias closed 3 years ago
When you write x = false
what you're really doing is _G.x = false
(aka declaring a global var x
in the current environment). If the current environment does not allow writing on _G
, you won't be able to declare anything in the global scope of that environment.
Use local x = false
instead.
EDIT: Depending on which lua version you're using, the environment might be set either using setfenv() or _ENV. Either way, use locals, don't pollute the global environment.
OK, understook. Thank you!
The following code
outputs
while the expected result would be
Installed version of busted: