mirror of
https://github.com/kikito/lua-sandbox.git
synced 2024-12-18 03:04:20 +00:00
cleanup
This commit is contained in:
parent
57a914f082
commit
3a90dc3319
@ -76,19 +76,14 @@ local function run(f, options)
|
||||
end
|
||||
end
|
||||
debug.sethook(timeout, "", step)
|
||||
|
||||
string.rep = nil
|
||||
|
||||
local ok, result = pcall(f)
|
||||
|
||||
cleanup()
|
||||
|
||||
if not ok then error(result) end
|
||||
|
||||
return result
|
||||
end
|
||||
|
||||
local sandbox = { run = run }
|
||||
|
||||
|
||||
return setmetatable(sandbox, {__call = function(_,f,o) return run(f,o) end})
|
||||
return setmetatable({run = run}, {__call = function(_,f,o) return run(f,o) end})
|
||||
|
Loading…
Reference in New Issue
Block a user