Bug 1118263 - remove deprecated for-each-in loops in accountprovisioner and about-support. r=mkmelin

This commit is contained in:
aceman 2015-04-14 18:41:10 +02:00
Родитель ed9d8c8bfa
Коммит 207e945758
6 изменённых файлов: 29 добавлений и 27 удалений

Просмотреть файл

@ -64,7 +64,7 @@ function populateAccountsSection() {
return createElement("td", text, attributes, copyData);
}
for (let [, account] in Iterator(gAccountDetails)) {
for (let account of gAccountDetails) {
// We want a minimum rowspan of 1
let rowSpan = account.smtpServers.length || 1;
// incomingTDs is a list of TDs
@ -83,8 +83,9 @@ function populateAccountsSection() {
let tr = createParentElement("tr", incomingTDs.concat(outgoingTDs[0]));
trAccounts.push(tr);
// Add the remaining SMTP servers as separate trs
for each (let [, tds] in Iterator(outgoingTDs.slice(1)))
for (let tds of outgoingTDs.slice(1)) {
trAccounts.push(createParentElement("tr", tds));
}
}
appendChildren(document.getElementById("accounts-tbody"), trAccounts);
@ -105,7 +106,7 @@ function getAccountsText(aHidePrivateData, aIndent) {
return data.neutral;
}
for (let [, account] in Iterator(gAccountDetails)) {
for (let account of gAccountDetails) {
accumulator.push(aIndent + account.key + ":");
// incomingData is a list of strings
let incomingData = [neutralizer(fn(account[prop]))

Просмотреть файл

@ -207,7 +207,7 @@ function populateGraphicsSection() {
data.indices = failureIndices.value;
}
}
let trGraphicFailures;
let trGraphicsFailures;
// If indices is there, it should be the same length as failures,
// (see Troubleshoot.jsm) but we check anyway:
if ("indices" in data && data.failures.length == data.indices.length) {
@ -235,9 +235,6 @@ function populateGraphicsSection() {
}
appendChildren(graphics_failures_tbody, trGraphicsFailures);
} // end if (gfxInfo)
let windows = Services.ww.getWindowEnumerator();

Просмотреть файл

@ -10,6 +10,7 @@ Components.utils.import("resource://gre/modules/AddonManager.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource:///modules/mailServices.js");
Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource:///modules/aboutSupport.js");
@ -63,9 +64,10 @@ window.onload = function () {
// Update the other sections.
populateAccountsSection();
populatePreferencesSection();
#ifdef MOZ_CRASHREPORTER
populateCrashesSection();
#endif
if (AppConstants.MOZ_CRASHREPORTER)
populateCrashesSection();
populateExtensionsSection();
populateGraphicsSection();
populateJavaScriptSection();
@ -85,11 +87,12 @@ function createParentElement(tagName, childElems) {
function createElement(tagName, textContent, opt_attributes, opt_copyData) {
if (opt_attributes == null)
opt_attributes = [];
opt_attributes = {};
let elem = document.createElement(tagName);
elem.textContent = textContent;
for each (let [key, value] in Iterator(opt_attributes))
elem.setAttribute(key, "" + value);
for (let key in opt_attributes) {
elem.setAttribute(key, "" + opt_attributes[key]);
}
if (opt_copyData != null) {
elem.dataset.copyData = opt_copyData;

Просмотреть файл

@ -112,7 +112,7 @@ function getModifiedPrefs() {
// time it's called. See bug 517312.
let prefNames = getWhitelistedPrefNames();
let prefs = [Application.prefs.get(prefName)
for each (prefName in prefNames)
for (prefName of prefNames)
if (Services.prefs.prefHasUserValue(prefName)
&& !isBlacklisted(prefName))];
return prefs;

Просмотреть файл

@ -6,7 +6,7 @@ messenger.jar:
% overlay chrome://messenger/content/messenger.xul chrome://messenger/content/about-support/overlay.xul
content/messenger/about-support/hide-private.css (content/hide-private.css)
content/messenger/about-support/show-private.css (content/show-private.css)
* content/messenger/about-support/init.js (content/init.js)
content/messenger/about-support/init.js (content/init.js)
content/messenger/about-support/accounts.js (content/accounts.js)
#ifdef MOZ_CRASHREPORTER
content/messenger/about-support/crashes.js (content/crashes.js)

Просмотреть файл

@ -571,9 +571,9 @@ var EmailAccountProvisioner = {
}
});
for each (let [i, provider] in Iterator(otherLangProviders)) {
for (let provider of otherLangProviders) {
providerList.append(provider);
};
}
if (otherLangProviders.length) {
let otherLangDesc = document.getElementById("otherLangDesc");
@ -732,7 +732,7 @@ var EmailAccountProvisioner = {
return;
}
for each (let [i, provider] in Iterator(returnedProviders)) {
for (let provider of returnedProviders) {
let group = $("<div class='resultsGroup'></div>");
let header = $("#resultsHeader")
.clone()
@ -750,8 +750,9 @@ var EmailAccountProvisioner = {
group.append(header);
let renderedAddresses = 0;
for each (let [j, address] in Iterator(provider.addresses)) {
let addrIndex = 0;
for (let address of provider.addresses) {
addrIndex++;
let tmplData = {
address: address,
};
@ -765,11 +766,11 @@ var EmailAccountProvisioner = {
// so if the provider's price is > 0, use that.
// Or if the provider's price is 0, use "Free".
if (address.price && address.price != "0")
tmplData.priceStr = stringBundle.get("price", [address.price])
tmplData.priceStr = stringBundle.get("price", [address.price]);
else if (address.price && address.price == "0")
tmplData.priceStr = stringBundle.get("free");
else if (provider.price && provider.price != "0")
tmplData.priceStr = stringBundle.get("price", [provider.price])
tmplData.priceStr = stringBundle.get("price", [provider.price]);
else
tmplData.priceStr = stringBundle.get("free");
@ -780,7 +781,7 @@ var EmailAccountProvisioner = {
// "More" buttons, etc.
renderedAddresses++;
if (j >= MAX_SMALL_ADDRESSES)
if (addrIndex >= MAX_SMALL_ADDRESSES)
result.addClass("extra").hide();
} catch(e) {
@ -807,10 +808,10 @@ var EmailAccountProvisioner = {
$("#notifications").children().hide();
$("#notifications .success").show();
for each (let [i, provider] in Iterator(data)) {
delete provider.succeeded
delete provider.addresses
delete provider.price
for (let provider of data) {
delete provider.succeeded;
delete provider.addresses;
delete provider.price;
storedData[provider.provider] = provider;
}
},