| 838 | |
| 839 | |
| 840 | l_noret luaG_errormsg (lua_State *L) { |
| 841 | if (L->errfunc != 0) { /* is there an error handling function? */ |
| 842 | StkId errfunc = restorestack(L, L->errfunc); |
| 843 | lua_assert(ttisfunction(s2v(errfunc))); |
| 844 | setobjs2s(L, L->top.p, L->top.p - 1); /* move argument */ |
| 845 | setobjs2s(L, L->top.p - 1, errfunc); /* push function */ |
| 846 | L->top.p++; /* assume EXTRA_STACK */ |
| 847 | luaD_callnoyield(L, L->top.p - 2, 1); /* call it */ |
| 848 | } |
| 849 | if (ttisnil(s2v(L->top.p - 1))) { /* error object is nil? */ |
| 850 | /* change it to a proper message */ |
| 851 | setsvalue2s(L, L->top.p - 1, luaS_newliteral(L, "<no error object>")); |
| 852 | } |
| 853 | luaD_throw(L, LUA_ERRRUN); |
| 854 | } |
| 855 | |
| 856 | |
| 857 | l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { |
no test coverage detected