mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-18 11:48:02 -04:00
re-implement
This commit is contained in:
parent
9cf2fbe9fd
commit
a4d2c21a73
@ -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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user