diff --git a/mozilla/js/src/jsapi.c b/mozilla/js/src/jsapi.c index 8cbb740a900..a08c2a58cfe 100644 --- a/mozilla/js/src/jsapi.c +++ b/mozilla/js/src/jsapi.c @@ -4507,7 +4507,7 @@ JS_ReportErrorFlagsAndNumberUC(JSContext *cx, uintN flags, JS_PUBLIC_API(void) JS_ReportOutOfMemory(JSContext *cx) { - js_ReportOutOfMemory(cx, js_GetErrorMessage); + js_ReportOutOfMemory(cx); } JS_PUBLIC_API(JSErrorReporter) diff --git a/mozilla/js/src/jscntxt.c b/mozilla/js/src/jscntxt.c index bb3efa2e025..71456c43b5a 100644 --- a/mozilla/js/src/jscntxt.c +++ b/mozilla/js/src/jscntxt.c @@ -712,14 +712,15 @@ ReportError(JSContext *cx, const char *message, JSErrorReport *reportp) * type message, and then hope the process ends swiftly. */ void -js_ReportOutOfMemory(JSContext *cx, JSErrorCallback callback) +js_ReportOutOfMemory(JSContext *cx) { JSStackFrame *fp; JSErrorReport report; JSErrorReporter onError = cx->errorReporter; /* Get the message for this error, but we won't expand any arguments. */ - const JSErrorFormatString *efs = callback(NULL, NULL, JSMSG_OUT_OF_MEMORY); + const JSErrorFormatString *efs = + js_GetLocalizedErrorMessage(cx, NULL, NULL, JSMSG_OUT_OF_MEMORY); const char *msg = efs ? efs->format : "Out of memory"; /* Fill out the report, but don't do anything that requires allocation. */ @@ -876,7 +877,7 @@ js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback, jschar *buffer, *fmt, *out; int expandedArgs = 0; size_t expandedLength; - size_t len = strlen (efs->format); + size_t len = strlen(efs->format); buffer = fmt = js_InflateString (cx, efs->format, &len); if (!buffer) diff --git a/mozilla/js/src/jscntxt.h b/mozilla/js/src/jscntxt.h index 5b1a2f62db2..247d05d8655 100644 --- a/mozilla/js/src/jscntxt.h +++ b/mozilla/js/src/jscntxt.h @@ -629,7 +629,7 @@ js_ExpandErrorArguments(JSContext *cx, JSErrorCallback callback, #endif extern void -js_ReportOutOfMemory(JSContext *cx, JSErrorCallback errorCallback); +js_ReportOutOfMemory(JSContext *cx); /* * Report an exception using a previously composed JSErrorReport.