Bug 1070842 - Factor script error event dispatch into a separate function. r=bz

This commit is contained in:
Bobby Holley 2014-09-29 15:34:21 +02:00
parent 94bd419133
commit 8b421a48d3
2 changed files with 12 additions and 1 deletions

View File

@ -486,10 +486,17 @@ SystemErrorReporter(JSContext *cx, const char *message, JSErrorReport *report)
// Otherwise, we need to asynchronously invoke onerror before we can decide
// whether or not to report the error to the console.
nsContentUtils::AddScriptRunner(new ScriptErrorEvent(win, JS_GetRuntime(cx), xpcReport, exception));
DispatchScriptErrorEvent(win, JS_GetRuntime(cx), xpcReport, exception);
}
}
void
DispatchScriptErrorEvent(nsPIDOMWindow *win, JSRuntime *rt, xpc::ErrorReport *xpcReport,
JS::Handle<JS::Value> exception)
{
nsContentUtils::AddScriptRunner(new ScriptErrorEvent(win, rt, xpcReport, exception));
}
} /* namespace xpc */
#ifdef DEBUG

View File

@ -532,6 +532,10 @@ class ErrorReport {
~ErrorReport() {}
};
void
DispatchScriptErrorEvent(nsPIDOMWindow *win, JSRuntime *rt, xpc::ErrorReport *xpcReport,
JS::Handle<JS::Value> exception);
} // namespace xpc
namespace mozilla {