Skip to content

Commit bb83679

Browse files
authoredNov 18, 2024
unpack() back/forward compat
1 parent 3ccaac1 commit bb83679

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed
 

‎lua/async.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
--#################### ############ ####################
44

55
local co = coroutine
6-
6+
local unpack = table.unpack or unpack
77

88
-- use with wrap
99
local pong = function (func, callback)
@@ -17,7 +17,7 @@ local pong = function (func, callback)
1717
assert(status, ret)
1818
if co.status(thread) == "dead" then
1919
if (callback) then
20-
(function (_, ...) callback(...) end)(table.unpack(pack))
20+
(function (_, ...) callback(...) end)(unpack(pack))
2121
end
2222
else
2323
assert(type(ret) == "function", "type error :: expected func - coroutine yielded some value")

0 commit comments

Comments
 (0)
Please sign in to comment.