Bug 1174954 part 2. Remove the special-casing of DOMError in JS-implemented webidl code. r=bholley
authorBoris Zbarsky <bzbarsky@mit.edu>
Tue, 16 Jun 2015 16:44:11 -0400
changeset 280012 b6f23bd165db2d864a5cceebc1aab2f9b98021d2
parent 280011 66f5705f110dde310906ffcc5ff111c5eee1f7a5
child 280013 a4093b87ff57bea9a91d40043b79cfbb524aaa1d
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-beta@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1174954
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1174954 part 2. Remove the special-casing of DOMError in JS-implemented webidl code. r=bholley
dom/bindings/BindingUtils.cpp
--- a/dom/bindings/BindingUtils.cpp
+++ b/dom/bindings/BindingUtils.cpp
@@ -277,35 +277,18 @@ ErrorResult::ReportJSException(JSContext
 }
 
 void
 ErrorResult::ReportJSExceptionFromJSImplementation(JSContext* aCx)
 {
   MOZ_ASSERT(!mMightHaveUnreportedJSException,
              "Why didn't you tell us you planned to handle JS exceptions?");
 
-  // Check for a DOMError, since we convert that into an Error in the content
-  // compartment.  We can probably remove that now; see bug 1174954.
-  dom::DOMError* domError;
-  nsresult rv = UNWRAP_OBJECT(DOMError, &mJSException.toObject(), domError);
-  if (NS_FAILED(rv)) {
-    // Just report it.
-    ReportJSException(aCx);
-    return;
-  }
-
-  nsString message;
-  domError->GetMessage(message);
-
-  JS_ReportError(aCx, "%hs", message.get());
-  js::RemoveRawValueRoot(aCx, &mJSException);
-
-  // We no longer have a useful exception but we do want to signal that an error
-  // occured.
-  mResult = NS_ERROR_FAILURE;
+  // Just report it.
+  ReportJSException(aCx);
 }
 
 void
 ErrorResult::StealJSException(JSContext* cx,
                               JS::MutableHandle<JS::Value> value)
 {
   MOZ_ASSERT(!mMightHaveUnreportedJSException,
              "Must call WouldReportJSException unconditionally in all codepaths that might call StealJSException");