summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/ChromeManifestParser.jsm
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-07-18 08:24:24 +0200
commitfc61780b35af913801d72086456f493f63197da6 (patch)
treef85891288a7bd988da9f0f15ae64e5c63f00d493 /toolkit/mozapps/extensions/ChromeManifestParser.jsm
parent69f7f9e5f1475891ce11cc4f431692f965b0cd30 (diff)
parent50d3e596bbe89c95615f96eb71f6bc5be737a1db (diff)
downloadUXP-2018.07.18.tar
UXP-2018.07.18.tar.gz
UXP-2018.07.18.tar.lz
UXP-2018.07.18.tar.xz
UXP-2018.07.18.zip
Merge commit '50d3e596bbe89c95615f96eb71f6bc5be737a1db' into Basilisk-releasev2018.07.18
# Conflicts: # browser/app/profile/firefox.js # browser/components/preferences/jar.mn
Diffstat (limited to 'toolkit/mozapps/extensions/ChromeManifestParser.jsm')
-rw-r--r--toolkit/mozapps/extensions/ChromeManifestParser.jsm28
1 files changed, 13 insertions, 15 deletions
diff --git a/toolkit/mozapps/extensions/ChromeManifestParser.jsm b/toolkit/mozapps/extensions/ChromeManifestParser.jsm
index 9a77c5429..63f1db785 100644
--- a/toolkit/mozapps/extensions/ChromeManifestParser.jsm
+++ b/toolkit/mozapps/extensions/ChromeManifestParser.jsm
@@ -45,7 +45,7 @@ this.ChromeManifestParser = {
* @return Array of objects describing each manifest instruction, in the form:
* { type: instruction-type, baseURI: string-uri, args: [arguments] }
**/
- parseSync: function CMP_parseSync(aURI) {
+ parseSync: function(aURI) {
function parseLine(aLine) {
let line = aLine.trim();
if (line.length == 0 || line.charAt(0) == '#')
@@ -80,14 +80,14 @@ this.ChromeManifestParser = {
lines.forEach(parseLine.bind(this));
return data;
},
-
- _readFromJar: function CMP_readFromJar(aURI) {
+
+ _readFromJar: function(aURI) {
let data = "";
let entries = [];
let readers = [];
-
+
try {
- // Deconstrict URI, which can be nested jar: URIs.
+ // Deconstrict URI, which can be nested jar: URIs.
let uri = aURI.clone();
while (uri instanceof Ci.nsIJARURI) {
entries.push(uri.JAREntry);
@@ -99,7 +99,7 @@ this.ChromeManifestParser = {
createInstance(Ci.nsIZipReader);
reader.open(uri.QueryInterface(Ci.nsIFileURL).file);
readers.push(reader);
-
+
// Open the nested jars.
for (let i = entries.length - 1; i > 0; i--) {
let innerReader = Cc["@mozilla.org/libjar/zip-reader;1"].
@@ -108,7 +108,7 @@ this.ChromeManifestParser = {
readers.push(innerReader);
reader = innerReader;
}
-
+
// First entry is the actual file we want to read.
let zis = reader.getInputStream(entries[0]);
data = NetUtil.readInputStreamToString(zis, zis.available());
@@ -120,15 +120,15 @@ this.ChromeManifestParser = {
flushJarCache(readers[i].file);
}
}
-
+
return data;
},
-
- _readFromFile: function CMP_readFromFile(aURI) {
+
+ _readFromFile: function(aURI) {
let file = aURI.QueryInterface(Ci.nsIFileURL).file;
if (!file.exists() || !file.isFile())
return "";
-
+
let data = "";
let fis = Cc["@mozilla.org/network/file-input-stream;1"].
createInstance(Ci.nsIFileInputStream);
@@ -151,9 +151,7 @@ this.ChromeManifestParser = {
* Instruction type to filter by.
* @return True if any matching instructions were found in the manifest.
*/
- hasType: function CMP_hasType(aManifest, aType) {
- return aManifest.some(function hasType_matchEntryType(aEntry) {
- return aEntry.type == aType;
- });
+ hasType: function(aManifest, aType) {
+ return aManifest.some(entry => entry.type == aType);
}
};