re-implement

This commit is contained in:
zeng-git 2025-01-09 00:01:22 +08:00
parent 9cf2fbe9fd
commit a4d2c21a73

View File

@ -52,9 +52,9 @@ end
_coroutine.wrap = function(f)
local thread = coroutine.create(f)
return function(...)
local result, reason = coroutine.resume(thread, ...)
assert(result, reason)
return reason
local result_pack = table.pack(coroutine.resume(thread, ...))
if not result_pack[1] then error(result_pack[2], 2) end
return table.unpack(result_pack, 2, result_pack.n)
end
end