-
Notifications
You must be signed in to change notification settings - Fork 38
coroutine.running
Philipp Janda edited this page Apr 21, 2015
·
1 revision
For PUC-Rio Lua 5.1 the (x)pcall functions use internal coroutines to
allow yielding. The compatibility implementations of debug.traceback
and coroutine.running
take that into account, but if you use the
compatibility versions of (x)pcall
to execute a function that uses
the original versions (e.g. via an upvalue), there could be problems.
In the case of debug.traceback
the stack trace will be incomplete,
but in the case of coroutine.running
the wrong coroutine (the one
started by (x)pcall
) is reported! To mitigate that risk load the
compat53
Lua module before all other modules, so that those cannot
keep a reference to the original 5.1 functions.