eris: add 'lua_isthrowing' support

This commit is contained in:
2023-04-06 17:26:03 -04:00
parent dc4a5f6198
commit b8df2bbc89
2 changed files with 4 additions and 0 deletions

View File

@@ -102,6 +102,9 @@ static void seterrorobj (lua_State *L, int errcode, StkId oldtop) {
L->top = oldtop + 1;
}
LUA_API int lua_isthrowing (lua_State *L) {
return ((L->errorJmp != NULL) && (L->errorJmp->status != LUA_OK));
}
l_noret luaD_throw (lua_State *L, int errcode) {
if (L->errorJmp) { /* thread has an error handler? */