Bug 765464 - Part a: Introduce JS_ReportErrorNumberVA; r=Waldo

This commit is contained in:
Ms2ger 2012-07-18 12:36:08 +02:00
parent c41391ca15
commit 3e342917f0
2 changed files with 16 additions and 3 deletions

View File

@ -6304,12 +6304,19 @@ JS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,
void *userRef, const unsigned errorNumber, ...) void *userRef, const unsigned errorNumber, ...)
{ {
va_list ap; va_list ap;
AssertHeapIsIdle(cx);
va_start(ap, errorNumber); va_start(ap, errorNumber);
JS_ReportErrorNumberVA(cx, errorCallback, userRef, errorNumber, ap);
va_end(ap);
}
JS_PUBLIC_API(void)
JS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,
void *userRef, const unsigned errorNumber,
va_list ap)
{
AssertHeapIsIdle(cx);
js_ReportErrorNumberVA(cx, JSREPORT_ERROR, errorCallback, userRef, js_ReportErrorNumberVA(cx, JSREPORT_ERROR, errorCallback, userRef,
errorNumber, JS_TRUE, ap); errorNumber, JS_TRUE, ap);
va_end(ap);
} }
JS_PUBLIC_API(void) JS_PUBLIC_API(void)

View File

@ -5650,6 +5650,12 @@ extern JS_PUBLIC_API(void)
JS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback, JS_ReportErrorNumber(JSContext *cx, JSErrorCallback errorCallback,
void *userRef, const unsigned errorNumber, ...); void *userRef, const unsigned errorNumber, ...);
#ifdef va_start
extern JS_PUBLIC_API(void)
JS_ReportErrorNumberVA(JSContext *cx, JSErrorCallback errorCallback,
void *userRef, const unsigned errorNumber, va_list ap);
#endif
/* /*
* Use an errorNumber to retrieve the format string, args are jschar * * Use an errorNumber to retrieve the format string, args are jschar *
*/ */