Bug 1174487. Stop using JS_ReportPendingException in ThrowAndReport. Just let the AutoJSAPI do the work for us. r=bholley
authorBoris Zbarsky <bzbarsky@mit.edu>
Mon, 15 Jun 2015 20:11:54 -0400
changeset 267087 d8f624689c04e88d8ba78a4c1ec0d9f165fdbd6f
parent 267086 026ce2bd75de74adf09794e32d40ad0467b6621f
child 267088 eb11e655d223ff83240f7a3d5e5e742ce4edbcfe
push id4932
push userjlund@mozilla.com
push dateMon, 10 Aug 2015 18:23:06 +0000
treeherdermozilla-esr52@6dd5a4f5f745 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1174487
milestone41.0a1
Bug 1174487. Stop using JS_ReportPendingException in ThrowAndReport. Just let the AutoJSAPI do the work for us. r=bholley
dom/bindings/Exceptions.cpp
--- a/dom/bindings/Exceptions.cpp
+++ b/dom/bindings/Exceptions.cpp
@@ -137,19 +137,19 @@ void
 ThrowAndReport(nsPIDOMWindow* aWindow, nsresult aRv, const char* aMessage)
 {
   MOZ_ASSERT(aRv != NS_ERROR_UNCATCHABLE_EXCEPTION,
              "Doesn't make sense to report uncatchable exceptions!");
   AutoJSAPI jsapi;
   if (NS_WARN_IF(!jsapi.InitWithLegacyErrorReporting(aWindow))) {
     return;
   }
+  jsapi.TakeOwnershipOfErrorReporting();
 
   Throw(jsapi.cx(), aRv, aMessage);
-  (void) JS_ReportPendingException(jsapi.cx());
 }
 
 already_AddRefed<Exception>
 CreateException(JSContext* aCx, nsresult aRv, const char* aMessage)
 {
   // Do we use DOM exceptions for this error code?
   switch (NS_ERROR_GET_MODULE(aRv)) {
   case NS_ERROR_MODULE_DOM: