fix bug with wrong errfunc index, caused by
@@ -95,6 +95,7 @@ static void luv_call_callback(lua_State* L, luv_handle_t* data, luv_callback_id
// And insert it before the args if there are any.
if (nargs) {
lua_insert(L, -1 - nargs);
+ errfunc -= nargs;
}
// Get the callback
lua_rawgeti(L, LUA_REGISTRYINDEX, ref);
