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? */

View File

@@ -150,6 +150,7 @@ LUA_API void (lua_insert) (lua_State *L, int idx);
LUA_API void (lua_replace) (lua_State *L, int idx);
LUA_API void (lua_copy) (lua_State *L, int fromidx, int toidx);
LUA_API int (lua_checkstack) (lua_State *L, int sz);
LUA_API int (lua_isthrowing) (lua_State *L);
LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n);