util/xpcall.lua
author Kim Alvefur <zash@zash.se>
Mon, 11 Jul 2022 18:48:57 +0200
changeset 12720 0b68b021ce46
parent 9564 cfc7b2f7251e
child 12979 d10957394a3c
permissions -rw-r--r--
util.paseto: Do strict type check in pae() function Fixes a test failure on Lua 5.4 where ipairs("") does not produce an error.

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;
};