diff --git a/moo/moolua/lua/ldo.c b/moo/moolua/lua/ldo.c index e8a91a58..97961907 100644 --- a/moo/moolua/lua/ldo.c +++ b/moo/moolua/lua/ldo.c @@ -108,6 +108,15 @@ L_GNUC_NORETURN void luaD_throw (lua_State *L, int errcode) { } +int luaD_inerror (lua_State *L) +{ + if (L->errorJmp) + return L->errorJmp->status != 0; + else + return 0; +} + + int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { struct lua_longjmp lj; lj.status = 0; diff --git a/moo/moolua/lua/ldo.h b/moo/moolua/lua/ldo.h index 98fddac5..a9fdd914 100644 --- a/moo/moolua/lua/ldo.h +++ b/moo/moolua/lua/ldo.h @@ -53,5 +53,7 @@ LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); +int luaD_inerror (lua_State *L); + #endif