util/xpcall.lua
author Matthew Wild <mwild1@gmail.com>
Fri, 26 Oct 2018 19:29:08 +0100
changeset 9564 cfc7b2f7251e
child 12979 d10957394a3c
permissions -rw-r--r--
util.xpcall, util.compat: Add non-hacky multi-argument xpcall() for Lua 5.1

local xpcall = xpcall;

if select(2, xpcall(function (x) return x end, function () end,  "test")) ~= "test" then
	xpcall = require"util.compat".xpcall;
end

return {
	xpcall = xpcall;
};