On Sat, Aug 27, 2011 at 17:03, Joshua Jensen<josh.jjensen@gmail.com> wrote:
* A hook to catch errors, allowing the debugger to break at the point of
error in the code and allow the user to investigate further.
* The ability to expand varargs.
The patch is below. Does Lua 5.2 expose facilities for this now?
static void funcinfo (lua_Debug *ar, Closure *cl) {
if (cl->c.isC) {
@@ -608,6 +626,8 @@
incr_top(L);
luaD_call(L, L->top - 2, 1); /* call it */
}
+ if (L->hookmask& LUA_MASKERROR)
+ luaD_callhook(L, LUA_HOOKERROR, -1);
luaD_throw(L, LUA_ERRRUN);
}
These seem like quite useful extensions, although I'm not sure what
the difference is between the error hook and the handler set by
xpcall...