mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-22 21:27:58 +01:00
Get rid of straggling 'for each'es.
This commit is contained in:
20
common/bootstrap.js
vendored
20
common/bootstrap.js
vendored
@@ -1,4 +1,4 @@
|
|||||||
// Copyright (c) 2010-2014 by Kris Maglione <maglione.k@gmail.com>
|
// Copyright (c) 2010-2015 by Kris Maglione <maglione.k@gmail.com>
|
||||||
//
|
//
|
||||||
// This work is licensed for reuse under an MIT license. Details are
|
// This work is licensed for reuse under an MIT license. Details are
|
||||||
// given in the LICENSE.txt file included with this file.
|
// given in the LICENSE.txt file included with this file.
|
||||||
@@ -113,7 +113,7 @@ let JSMLoader = {
|
|||||||
if (typeof arg !== "string")
|
if (typeof arg !== "string")
|
||||||
this._atexit.push(arguments);
|
this._atexit.push(arguments);
|
||||||
else
|
else
|
||||||
for each (let [fn, self] in this._atexit)
|
for (let [fn, self] of this._atexit)
|
||||||
try {
|
try {
|
||||||
fn.call(self, arg);
|
fn.call(self, arg);
|
||||||
}
|
}
|
||||||
@@ -127,7 +127,7 @@ let JSMLoader = {
|
|||||||
if (name.indexOf(":") === -1)
|
if (name.indexOf(":") === -1)
|
||||||
urls = this.config["module-paths"].map(path => path + name + ".jsm");
|
urls = this.config["module-paths"].map(path => path + name + ".jsm");
|
||||||
|
|
||||||
for each (let url in urls)
|
for (let url of urls)
|
||||||
try {
|
try {
|
||||||
var uri = this.getTarget(url);
|
var uri = this.getTarget(url);
|
||||||
if (uri in this.globals)
|
if (uri in this.globals)
|
||||||
@@ -171,7 +171,7 @@ let JSMLoader = {
|
|||||||
|
|
||||||
let module = this.modules[name];
|
let module = this.modules[name];
|
||||||
if (target)
|
if (target)
|
||||||
for each (let symbol in module.EXPORTED_SYMBOLS)
|
for (let symbol of module.EXPORTED_SYMBOLS)
|
||||||
try {
|
try {
|
||||||
Object.defineProperty(target, symbol, {
|
Object.defineProperty(target, symbol, {
|
||||||
configurable: true,
|
configurable: true,
|
||||||
@@ -293,8 +293,8 @@ function init() {
|
|||||||
|
|
||||||
Cc[BOOTSTRAP_CONTRACT].getService().wrappedJSObject.loader = !Cu.unload && JSMLoader;
|
Cc[BOOTSTRAP_CONTRACT].getService().wrappedJSObject.loader = !Cu.unload && JSMLoader;
|
||||||
|
|
||||||
for each (let component in components)
|
for (let key in components)
|
||||||
component.register();
|
components[key].register();
|
||||||
|
|
||||||
updateVersion();
|
updateVersion();
|
||||||
|
|
||||||
@@ -419,7 +419,7 @@ function shutdown(data, reason) {
|
|||||||
JSMLoader.atexit(strReason);
|
JSMLoader.atexit(strReason);
|
||||||
JSMLoader.cleanup(strReason);
|
JSMLoader.cleanup(strReason);
|
||||||
|
|
||||||
for each (let [category, entry] in JSMLoader.config.categories)
|
for (let [category, entry] of JSMLoader.config.categories)
|
||||||
categoryManager.deleteCategoryEntry(category, entry, false);
|
categoryManager.deleteCategoryEntry(category, entry, false);
|
||||||
for (let resource in JSMLoader.config.resources)
|
for (let resource in JSMLoader.config.resources)
|
||||||
resourceProto.setSubstitution(resource, null);
|
resourceProto.setSubstitution(resource, null);
|
||||||
@@ -449,9 +449,9 @@ function uninstall(data, reason) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function reasonToString(reason) {
|
function reasonToString(reason) {
|
||||||
for each (let name in ["disable", "downgrade", "enable",
|
for (let name of ["disable", "downgrade", "enable",
|
||||||
"install", "shutdown", "startup",
|
"install", "shutdown", "startup",
|
||||||
"uninstall", "upgrade"])
|
"uninstall", "upgrade"])
|
||||||
if (reason == global["ADDON_" + name.toUpperCase()] ||
|
if (reason == global["ADDON_" + name.toUpperCase()] ||
|
||||||
reason == global["APP_" + name.toUpperCase()])
|
reason == global["APP_" + name.toUpperCase()])
|
||||||
return name;
|
return name;
|
||||||
|
|||||||
Reference in New Issue
Block a user