fix util.runfunction

This commit is contained in:
Kan18 2019-07-19 17:08:54 -04:00 committed by GitHub
parent c0c054f802
commit 498ab968ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -551,8 +551,9 @@ function Util.run(env, path, ...)
end
function Util.runFunction(env, fn, ...)
setfenv(fn, env)
--setfenv(fn, env)
setmetatable(env, { __index = _G })
fn = load(fn,"util.runfunction",nil,env)
return pcall(fn, ...)
end