Bug 1004295 - Hard abort if we try to unload modules when loader global reuse is enabled. r=mccr8
authorBobby Holley <bobbyholley@gmail.com>
Thu, 01 May 2014 11:02:59 -0700
changeset 181632 9f4a5b6678ddcaa7b717865fb2a05d324d8075de
parent 181631 090bd7835f8290ff8cfb2495cea2b4ab54114e07
child 181633 660ddfb69dc52596869d62368b2194acac1d440a
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewersmccr8
bugs1004295
milestone32.0a1
Bug 1004295 - Hard abort if we try to unload modules when loader global reuse is enabled. r=mccr8
js/xpconnect/loader/mozJSComponentLoader.cpp
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -1367,16 +1367,19 @@ NS_IMETHODIMP
 mozJSComponentLoader::Unload(const nsACString & aLocation)
 {
     nsresult rv;
 
     if (!mInitialized) {
         return NS_OK;
     }
 
+    MOZ_RELEASE_ASSERT(!mReuseLoaderGlobal, "Module unloading not supported when "
+                                            "compartment sharing is enabled");
+
     nsCOMPtr<nsIIOService> ioService = do_GetIOService(&rv);
     NS_ENSURE_SUCCESS(rv, rv);
 
     // Get the URI.
     nsCOMPtr<nsIURI> resURI;
     rv = ioService->NewURI(aLocation, nullptr, nullptr, getter_AddRefs(resURI));
     NS_ENSURE_SUCCESS(rv, rv);