mirror of
https://github.com/lua/lua
synced 2025-04-25 15:03:03 +03:00
error handler does not need to be a function (can be a callable
object)
This commit is contained in:
parent
5fae2a5b05
commit
b4633c586b
3
ldebug.c
3
ldebug.c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
** $Id: ldebug.c,v 2.107 2014/11/11 17:08:19 roberto Exp roberto $
|
** $Id: ldebug.c,v 2.108 2014/12/08 15:48:23 roberto Exp roberto $
|
||||||
** Debug Interface
|
** Debug Interface
|
||||||
** See Copyright Notice in lua.h
|
** See Copyright Notice in lua.h
|
||||||
*/
|
*/
|
||||||
@ -590,7 +590,6 @@ static void addinfo (lua_State *L, const char *msg) {
|
|||||||
l_noret luaG_errormsg (lua_State *L) {
|
l_noret luaG_errormsg (lua_State *L) {
|
||||||
if (L->errfunc != 0) { /* is there an error handling function? */
|
if (L->errfunc != 0) { /* is there an error handling function? */
|
||||||
StkId errfunc = restorestack(L, L->errfunc);
|
StkId errfunc = restorestack(L, L->errfunc);
|
||||||
if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR);
|
|
||||||
setobjs2s(L, L->top, L->top - 1); /* move argument */
|
setobjs2s(L, L->top, L->top - 1); /* move argument */
|
||||||
setobjs2s(L, L->top - 1, errfunc); /* push function */
|
setobjs2s(L, L->top - 1, errfunc); /* push function */
|
||||||
L->top++; /* assume EXTRA_STACK */
|
L->top++; /* assume EXTRA_STACK */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user