Skip to content

Commit

Permalink
re-implement
Browse files Browse the repository at this point in the history
  • Loading branch information
zeng-github01 committed Jan 8, 2025
1 parent 9cf2fbe commit a4d2c21
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit a4d2c21

Please sign in to comment.