Bug 695843 part 8 - Properly handle jar-in-jars when importing modules. r=mrbkap
authorMike Hommey <mh+mozilla@glandium.org>
Thu, 08 Dec 2011 11:03:36 +0100
changeset 82250 2dd63b2aa323477c6ae9ccaed57b5558c109b164
parent 82249 00d65419d422b70b44162641d845afc823caee09
child 82251 502c67d69baa1c2e214781d5d92df7db9e4c0918
push id21587
push userbmo@edmorley.co.uk
push dateThu, 08 Dec 2011 15:13:43 +0000
treeherdermozilla-central@98db2311a44c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs695843
milestone11.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 695843 part 8 - Properly handle jar-in-jars when importing modules. r=mrbkap
js/xpconnect/loader/mozJSComponentLoader.cpp
--- a/js/xpconnect/loader/mozJSComponentLoader.cpp
+++ b/js/xpconnect/loader/mozJSComponentLoader.cpp
@@ -1148,19 +1148,20 @@ mozJSComponentLoader::ImportInto(const n
     NS_ENSURE_SUCCESS(rv, rv);
 
     // get the JAR if there is one
     nsCOMPtr<nsIJARURI> jarURI;
     jarURI = do_QueryInterface(resolvedURI, &rv);
     nsCOMPtr<nsIFileURL> baseFileURL;
     if (NS_SUCCEEDED(rv)) {
         nsCOMPtr<nsIURI> baseURI;
-        rv = jarURI->GetJARFile(getter_AddRefs(baseURI));
-        NS_ENSURE_SUCCESS(rv, rv);
-
+        while (jarURI) {
+            jarURI->GetJARFile(getter_AddRefs(baseURI));
+            jarURI = do_QueryInterface(baseURI, &rv);
+        }
         baseFileURL = do_QueryInterface(baseURI, &rv);
         NS_ENSURE_SUCCESS(rv, rv);
     } else {
         baseFileURL = do_QueryInterface(resolvedURI, &rv);
         NS_ENSURE_SUCCESS(rv, rv);
     }
 
     nsCOMPtr<nsIFile> sourceFile;