Software /
code /
prosody
File
util/xpcall.lua @ 11437:87a684df4b65
util.datamapper: Invent extension for using tag name as value
Useful for certain enum-like uses where the element name is the relevant
information, e.g. chat states.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 06 Mar 2021 23:14:23 +0100 |
parent | 9561:cfc7b2f7251e |
child | 12975:d10957394a3c |
line wrap: on
line source
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; };