mirror of
https://github.com/TangentFoxy/lua-sandbox.git
synced 2025-07-28 02:52:22 +00:00
cleanup
This commit is contained in:
@@ -76,19 +76,14 @@ local function run(f, options)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
debug.sethook(timeout, "", step)
|
debug.sethook(timeout, "", step)
|
||||||
|
|
||||||
string.rep = nil
|
string.rep = nil
|
||||||
|
|
||||||
local ok, result = pcall(f)
|
local ok, result = pcall(f)
|
||||||
|
|
||||||
cleanup()
|
cleanup()
|
||||||
|
|
||||||
if not ok then error(result) end
|
if not ok then error(result) end
|
||||||
|
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
local sandbox = { run = run }
|
return setmetatable({run = run}, {__call = function(_,f,o) return run(f,o) end})
|
||||||
|
|
||||||
|
|
||||||
return setmetatable(sandbox, {__call = function(_,f,o) return run(f,o) end})
|
|
||||||
|
Reference in New Issue
Block a user