Bug 1259290: Part 4 - Remove JS_ReportError for a situation that can never happen. r=bz
authorKyle Huey <khuey@kylehuey.com>
Mon, 28 Mar 2016 10:28:14 -0700
changeset 290737 a4dbc5475d87762085ac168a1c701a35e16016f7
parent 290736 d317ee09ff1a1bda98797be54b7d2f7dc10b84d6
child 290738 e979e75c94f650e3a1ecf4b3416a8ab605edb417
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1259290
milestone48.0a1
Bug 1259290: Part 4 - Remove JS_ReportError for a situation that can never happen. r=bz
dom/workers/ScriptLoader.cpp
--- a/dom/workers/ScriptLoader.cpp
+++ b/dom/workers/ScriptLoader.cpp
@@ -714,21 +714,17 @@ private:
 
     if (aStatus >= Terminating && !mCanceled) {
       mCanceled = true;
 
       nsCOMPtr<nsIRunnable> runnable =
         NS_NewRunnableMethod(this,
           &ScriptLoaderRunnable::CancelMainThreadWithBindingAborted);
       NS_ASSERTION(runnable, "This should never fail!");
-
-      if (NS_FAILED(NS_DispatchToMainThread(runnable))) {
-        JS_ReportError(aCx, "Failed to cancel script loader!");
-        return false;
-      }
+      MOZ_ALWAYS_TRUE(NS_SUCCEEDED(NS_DispatchToMainThread(runnable)));
     }
 
     return true;
   }
 
   bool
   IsMainWorkerScript() const
   {