This commit is contained in:
kikito 2013-09-03 13:15:47 +02:00
parent 57a914f082
commit 3a90dc3319

View File

@ -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})