mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 23:33:53 +01:00
Localize variable
This commit is contained in:
parent
82f0e2942a
commit
91841fdfa4
2
init.lua
2
init.lua
@ -10,7 +10,7 @@ if _VERSION then
|
|||||||
function setfenv(fn, env)
|
function setfenv(fn, env)
|
||||||
local i = 1
|
local i = 1
|
||||||
while true do
|
while true do
|
||||||
name = debug.getupvalue(fn, i)
|
local name = debug.getupvalue(fn, i)
|
||||||
if name == "_ENV" then
|
if name == "_ENV" then
|
||||||
debug.setupvalue(fn, i, env)
|
debug.setupvalue(fn, i, env)
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user