Skip to content

Commit

Permalink
fix(compat): simplify _xpcall function
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinhwang91 committed Feb 27, 2024
1 parent 9d5d173 commit e8d3271
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions lua/promise-async/compat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,7 @@ if M.is51() then
M.xpcall = function(f, msgh, ...)
local thread = coroutine.running()
if not thread then
local args, n = {...}, select('#', ...)
return _xpcall(function()
return f(unpack(args, 1, n))
end, msgh)
return _xpcall(f, msgh, ...)
end
return xpcallCatch(msgh, doPcall(thread, f, ...))
end
Expand Down

0 comments on commit e8d3271

Please sign in to comment.