-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This changes the error handling to be closer to PUC Lua's implementation: raising an error just "jumps" to the location of pcall. From there, we call the error function, and then unwind the stack, closing any upvalues. This has the advantage that the callstack of coroutines is maintained, even if they error, as the handles are no longer popped. One thing to be aware of here is that return hooks are no longer called on errors. While this may be a little counter-intuitive, it is consistent with how PUC Lua operates. Note, Lua actually calls the error handler when throwing the error, rather than when catching it. However, this way means we don't need to thread a LuaState everywhere we want to throw an error.
- Loading branch information
Showing
6 changed files
with
467 additions
and
457 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.