Permalink
Browse files

Fix backward compatibility with Lua 5.1 - coxpcall required...

Resolves "attempt to yield across metamethod/C-call boundary" errors when running Wsapi apps such as Orbit on Lua < 5.2
  • Loading branch information...
kognix committed Dec 6, 2013
1 parent 810ecd0 commit f89bbea2f004f779511ffbcaaed18692fa5bbe20
Showing with 6 additions and 0 deletions.
  1. +6 −0 src/wsapi/common.lua
View
@@ -18,6 +18,12 @@ local lfs = require "lfs"
local tostring, tonumber, pairs, ipairs, error, type, pcall, xpcall, setmetatable, dofile, rawget, rawset, assert, loadfile =
tostring, tonumber, pairs, ipairs, error, type, pcall, xpcall, setmetatable, dofile, rawget, rawset, assert, loadfile
if _VERSION < "Lua 5.2" then
local coxpcall = require "coxpcall"
pcall = coxpcall.pcall
xpcall = coxpcall.xpcall
end
local package = package
local _, ringer = pcall(require, "wsapi.ringer")

0 comments on commit f89bbea

Please sign in to comment.