Merge pull request #2654 from psychon/luajit-xpcall

gears.protected_call: Automatically detect xpcall features
This commit is contained in:
mergify[bot] 2019-02-18 01:42:40 +00:00 committed by GitHub
commit 710278c4b9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ local function handle_result(success, ...)
end
local do_pcall
if _VERSION <= "Lua 5.1" then
if not select(2, xpcall(function(a) return a end, error, true)) then
-- Lua 5.1 doesn't support arguments in xpcall :-(
do_pcall = function(func, ...)
local args = { ... }