diff --git a/src/error.c b/src/error.c index 237728036af71c76ae05cf72025f5dd0fa0d63a1..77287709123083f692c40033577b718046c786b1 100644 --- a/src/error.c +++ b/src/error.c @@ -673,6 +673,28 @@ static void f_error_index(INT32 args) } } +static void f_error__sizeof(INT32 args) +{ + pop_n_elems(args); + push_int(2); +} + +static void f_error__indices(INT32 args) +{ + pop_n_elems(args); + push_int(0); + push_int(1); + f_aggregate(2); +} + +static void f_error__values(INT32 args) +{ + pop_n_elems(args); + apply_current(generic_err_message_fun, 0); + apply_current(generic_err_backtrace_fun, 0); + f_aggregate(2); +} + /*! @decl string describe() *! *! Return a readable error report that includes the backtrace. diff --git a/src/errors.h b/src/errors.h index 64d41f011d6db7779de835ca5d67480afd489722..d0d9d659b78fa32a47c14ed4f8037483cebbc9ca 100644 --- a/src/errors.h +++ b/src/errors.h @@ -114,6 +114,9 @@ DECLARE_ERROR(generic, Generic, EMPTY , ERR_VAR(struct array *,tArray,PIKE_T_ARRAY,error_backtrace) ERR_FUNC("cast",f_error_cast,tFunc(tString,tArray),ID_PROTECTED) ERR_FUNC("`[]",f_error_index,tFunc(tInt01,tMixed),ID_PROTECTED) + ERR_FUNC("_sizeof",f_error__sizeof,tFunc(tNone,tInt2),ID_PROTECTED) + ERR_FUNC("_indices",f_error__indices,tFunc(tNone,tArr(tInt01)),ID_PROTECTED) + ERR_FUNC("_values",f_error__values,tFunc(tNone,tArr(tOr(tStr,tArr(tMixed)))),ID_PROTECTED) ERR_FUNC("describe",f_error_describe,tFunc(tVoid,tString),0) ERR_FUNC_SAVE_ID (generic_err_message_fun, "message", f_error_message, tFunc(tVoid,tString), 0)