mirror of
https://github.com/AmberGraceRblx/luau-promise.git
synced 2025-04-24 15:50:01 +00:00
Fix #3
This commit is contained in:
parent
e86c068ce2
commit
1ca7dfbc3e
1 changed files with 4 additions and 1 deletions
|
@ -35,7 +35,10 @@ end
|
|||
Handles errors if they happen.
|
||||
]]
|
||||
local function ppcall(yieldError, callback, ...)
|
||||
local co = coroutine.create(callback)
|
||||
-- Wrapped because C functions can't be passed to coroutine.create!
|
||||
local co = coroutine.create(function(...)
|
||||
return callback(...)
|
||||
end)
|
||||
|
||||
local ok, len, result = packResult(coroutine.resume(co, ...))
|
||||
|
||||
|
|
Loading…
Reference in a new issue