Bug 938131 - Simplify dom::ErrorResult::ReportJSExceptionFromJSImplementation. r=bz.

--HG--
extra : rebase_source : db7b8edd1aec3aff7240b1323c00546d2e332112
This commit is contained in:
Peter Van der Beken 2013-10-18 13:22:09 +02:00
parent 13a5c31806
commit 942e6b4680

View File

@ -214,16 +214,7 @@ ErrorResult::ReportJSExceptionFromJSImplementation(JSContext* aCx)
nsString message; nsString message;
domError->GetMessage(message); domError->GetMessage(message);
JSErrorReport errorReport; JS_ReportError(aCx, "%hs", message.get());
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_RemoveValueRoot(aCx, &mJSException); JS_RemoveValueRoot(aCx, &mJSException);
// We no longer have a useful exception but we do want to signal that an error // We no longer have a useful exception but we do want to signal that an error