mirror of
https://github.com/britzl/monarch.git
synced 2025-06-27 10:27:49 +02:00
Assert on coroutine.resume to catch more errors
This commit is contained in:
parent
9afd77e2b0
commit
e4ca53630e
@ -72,7 +72,7 @@ local function cowait(delay)
|
||||
local co = coroutine.running()
|
||||
assert(co, "You must run this form within a coroutine")
|
||||
timer.delay(delay, false, function()
|
||||
coroutine.resume(co)
|
||||
assert(coroutine.resume(co))
|
||||
end)
|
||||
coroutine.yield()
|
||||
end
|
||||
@ -594,7 +594,7 @@ function M.show(id, options, data, cb)
|
||||
while top.popup do
|
||||
stack[#stack] = nil
|
||||
show_out(top, screen, function()
|
||||
coroutine.resume(co)
|
||||
assert(coroutine.resume(co))
|
||||
end)
|
||||
coroutine.yield()
|
||||
top = stack[#stack]
|
||||
@ -624,7 +624,7 @@ function M.show(id, options, data, cb)
|
||||
-- screen that has Preload set to true
|
||||
if M.is_preloading(id) then
|
||||
M.when_preloaded(id, function()
|
||||
coroutine.resume(co)
|
||||
assert(coroutine.resume(co))
|
||||
end)
|
||||
coroutine.yield()
|
||||
end
|
||||
@ -632,7 +632,7 @@ function M.show(id, options, data, cb)
|
||||
|
||||
if cb then callbacks.when_done(cb) end
|
||||
end)
|
||||
coroutine.resume(co)
|
||||
assert(coroutine.resume(co))
|
||||
|
||||
return true
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user