You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a pointless assert in the example of "beautiful asynchronous code":
localco=assert(coroutine.running(), "Should be run in a coroutine")
Since Lua 5.2, the first value returned by coroutine.running() is always truthy.
Probably, the second returned value must be inspected instead of the first one?
Something like the following:
localco, is_main=coroutine.running()
assert(notis_main, "Should be run in a coroutine")
The text was updated successfully, but these errors were encountered:
There is a pointless
assert
in the example of "beautiful asynchronous code":Since Lua 5.2, the first value returned by
coroutine.running()
is always truthy.Probably, the second returned value must be inspected instead of the first one?
Something like the following:
The text was updated successfully, but these errors were encountered: