diff --git a/dom/bindings/BindingUtils.cpp b/dom/bindings/BindingUtils.cpp index e76caf924df..cd688c7bedb 100644 --- a/dom/bindings/BindingUtils.cpp +++ b/dom/bindings/BindingUtils.cpp @@ -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 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