Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 f89bbea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/wsapi/common.lua
Expand Up @@ -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")
Expand Down

0 comments on commit f89bbea

Please sign in to comment.