aboutsummaryrefslogtreecommitdiffstats
path: root/util/xpcall.lua
diff options
context:
space:
mode:
Diffstat (limited to 'util/xpcall.lua')
-rw-r--r--util/xpcall.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/util/xpcall.lua b/util/xpcall.lua
new file mode 100644
index 00000000..d2fc5011
--- /dev/null
+++ b/util/xpcall.lua
@@ -0,0 +1,9 @@
+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;
+};