Fix global warnings if strictness is enabled

master
Lars Mueller 2021-01-17 18:18:32 +01:00
parent 1ca5471244
commit eacf925be0
1 changed files with 3 additions and 3 deletions

View File

@ -3,10 +3,10 @@ function set_insecure_environment(env)
env = env or _G env = env or _G
os_execute = env.os.execute os_execute = env.os.execute
local socket local socket
local original_require = _G.require local original_require = rawget(_G, "require")
_G.require = env.require rawset(_G, "require", env.require)
pcall(function() socket = env.require"socket" end) pcall(function() socket = env.require"socket" end)
_G.require = original_require rawset(_G, "require", original_require)
build_bridge = (socket and build_socket_bridge) or build_file_bridge build_bridge = (socket and build_socket_bridge) or build_file_bridge
set_insecure_environment = nil set_insecure_environment = nil
end end