hishamhm/lua-compat-5.2 — pull request #9 by renatomaia (2014-02-16 18:08:38+00:00)
Title: 'pcall' and 'xpcall' that support 'coroutine.yield'

Just added support for 'pcall' and 'xpcall' that support 'coroutine.yield'. This is done executing the protected code inside a coroutine. The main problem with this is that the protected executes in a separate stack. So if the application inspects the stack using the 'debug' library it might get weird results. I tried to minimize this problem with a new 'debug.traceback' that concatenates all the stack tracebacks of all nested 'pcall'. But I didn't to it for other 'debug' functions, so they will expose the underlying workaround using coroutines.