mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 981198 - Internally move the JSErrorReporter to the JSRuntime. r=terrence
This commit is contained in:
parent
ca02b737d0
commit
03852284c1
@ -5769,7 +5769,7 @@ JS_ReportAllocationOverflow(JSContext *cx)
|
||||
JS_PUBLIC_API(JSErrorReporter)
|
||||
JS_GetErrorReporter(JSContext *cx)
|
||||
{
|
||||
return cx->errorReporter;
|
||||
return cx->runtime()->errorReporter;
|
||||
}
|
||||
|
||||
JS_PUBLIC_API(JSErrorReporter)
|
||||
@ -5777,8 +5777,8 @@ JS_SetErrorReporter(JSContext *cx, JSErrorReporter er)
|
||||
{
|
||||
JSErrorReporter older;
|
||||
|
||||
older = cx->errorReporter;
|
||||
cx->errorReporter = er;
|
||||
older = cx->runtime()->errorReporter;
|
||||
cx->runtime()->errorReporter = er;
|
||||
return older;
|
||||
}
|
||||
|
||||
|
@ -387,7 +387,7 @@ js_ReportOutOfMemory(ThreadSafeContext *cxArg)
|
||||
PopulateReportBlame(cx, &report);
|
||||
|
||||
/* Report the error. */
|
||||
if (JSErrorReporter onError = cx->errorReporter) {
|
||||
if (JSErrorReporter onError = cx->runtime()->errorReporter) {
|
||||
AutoSuppressGC suppressGC(cx);
|
||||
onError(cx, msg, &report);
|
||||
}
|
||||
@ -877,7 +877,7 @@ js::CallErrorReporter(JSContext *cx, const char *message, JSErrorReport *reportp
|
||||
JS_ASSERT(message);
|
||||
JS_ASSERT(reportp);
|
||||
|
||||
if (JSErrorReporter onError = cx->errorReporter)
|
||||
if (JSErrorReporter onError = cx->runtime()->errorReporter)
|
||||
onError(cx, message, reportp);
|
||||
}
|
||||
|
||||
@ -1108,7 +1108,6 @@ JSContext::JSContext(JSRuntime *rt)
|
||||
generatingError(false),
|
||||
savedFrameChains_(),
|
||||
cycleDetectorSet(MOZ_THIS_IN_INITIALIZER_LIST()),
|
||||
errorReporter(nullptr),
|
||||
data(nullptr),
|
||||
data2(nullptr),
|
||||
outstandingRequests(0),
|
||||
|
@ -460,9 +460,6 @@ struct JSContext : public js::ExclusiveContext,
|
||||
/* State for object and array toSource conversion. */
|
||||
js::ObjectSet cycleDetectorSet;
|
||||
|
||||
/* Per-context optional error reporter. */
|
||||
JSErrorReporter errorReporter;
|
||||
|
||||
/* Client opaque pointers. */
|
||||
void *data;
|
||||
void *data2;
|
||||
|
@ -190,6 +190,7 @@ JSRuntime::JSRuntime(JSRuntime *parentRuntime)
|
||||
destroyPrincipals(nullptr),
|
||||
structuredCloneCallbacks(nullptr),
|
||||
telemetryCallback(nullptr),
|
||||
errorReporter(nullptr),
|
||||
propertyRemovals(0),
|
||||
#if !EXPOSE_INTL_API
|
||||
thousandsSeparator(0),
|
||||
|
@ -1095,6 +1095,9 @@ struct JSRuntime : public JS::shadow::Runtime,
|
||||
/* Call this to accumulate telemetry data. */
|
||||
JSAccumulateTelemetryDataCallback telemetryCallback;
|
||||
|
||||
/* Optional error reporter. */
|
||||
JSErrorReporter errorReporter;
|
||||
|
||||
/* AsmJSCache callbacks are runtime-wide. */
|
||||
JS::AsmJSCacheOps asmJSCacheOps;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user