Skip to content

Commit 5c5a6aa

Browse files
committed
Merge pull request #30 from kognix/master
Wsapi 1.6 breaks Orbit and potentially other Lua 5.1 apps...
2 parents de611a0 + f89bbea commit 5c5a6aa

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/wsapi/common.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ local lfs = require "lfs"
1818
local tostring, tonumber, pairs, ipairs, error, type, pcall, xpcall, setmetatable, dofile, rawget, rawset, assert, loadfile =
1919
tostring, tonumber, pairs, ipairs, error, type, pcall, xpcall, setmetatable, dofile, rawget, rawset, assert, loadfile
2020

21+
if _VERSION < "Lua 5.2" then
22+
local coxpcall = require "coxpcall"
23+
pcall = coxpcall.pcall
24+
xpcall = coxpcall.xpcall
25+
end
26+
2127
local package = package
2228

2329
local _, ringer = pcall(require, "wsapi.ringer")

src/wsapi/xavante.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
--
77
-----------------------------------------------------------------------------
88

9-
require "coxpcall"
9+
local coxpcall = require "coxpcall"
1010

11-
pcall = copcall
12-
xpcall = coxpcall
11+
pcall = coxpcall.pcall
12+
xpcall = coxpcall.xpcall
1313

1414
local common = require"wsapi.common"
1515

0 commit comments

Comments
 (0)