summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/extensions/ChromeManifestParser.jsm
diff options
context:
space:
mode:
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);
}
};