зеркало из https://github.com/mozilla/gecko-dev.git
Bug 938131 - Simplify dom::ErrorResult::ReportJSExceptionFromJSImplementation. r=bz.
--HG-- extra : rebase_source : db7b8edd1aec3aff7240b1323c00546d2e332112
This commit is contained in:
Родитель
e50efdc6a3
Коммит
97c1353a69
|
@ -214,16 +214,7 @@ ErrorResult::ReportJSExceptionFromJSImplementation(JSContext* aCx)
|
|||
nsString message;
|
||||
domError->GetMessage(message);
|
||||
|
||||
JSErrorReport errorReport;
|
||||
memset(&errorReport, 0, sizeof(JSErrorReport));
|
||||
errorReport.errorNumber = JSMSG_USER_DEFINED_ERROR;
|
||||
errorReport.ucmessage = message.get();
|
||||
errorReport.exnType = JSEXN_ERR;
|
||||
JS::Rooted<JSScript*> script(aCx);
|
||||
if (JS_DescribeScriptedCaller(aCx, &script, &errorReport.lineno)) {
|
||||
errorReport.filename = JS_GetScriptFilename(aCx, script);
|
||||
}
|
||||
JS_ThrowReportedError(aCx, nullptr, &errorReport);
|
||||
JS_ReportError(aCx, "%hs", message.get());
|
||||
JS_RemoveValueRoot(aCx, &mJSException);
|
||||
|
||||
// We no longer have a useful exception but we do want to signal that an error
|
||||
|
|
Загрузка…
Ссылка в новой задаче