Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: chrome/content/ui/sendReport.js

Issue 6519778499887104: Issue 2010 - Remove some uses of "for each" with "for of" (Closed)
Patch Set: Created Feb. 26, 2015, 11:50 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/content/ui/filters-subscriptionview.js ('k') | chrome/content/ui/sidebar.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/sendReport.js
===================================================================
--- a/chrome/content/ui/sendReport.js
+++ b/chrome/content/ui/sendReport.js
@@ -906,70 +906,70 @@ let issuesDataSource =
{
this.contentWnd = wnd;
this.whitelistFilter = Policy.isWindowWhitelisted(wnd);
if (!this.whitelistFilter && this.isEnabled)
{
// Find disabled filters in active subscriptions matching any of the requests
let disabledMatcher = new CombinedMatcher();
- for each (let subscription in FilterStorage.subscriptions)
+ for (let subscription of FilterStorage.subscriptions)
{
if (subscription.disabled)
continue;
- for each (let filter in subscription.filters)
+ for (let filter of subscription.filters)
if (filter instanceof BlockingFilter && filter.disabled)
disabledMatcher.add(filter);
}
let seenFilters = Object.create(null);
- for each (let request in requestsDataSource.origRequests)
+ for (let request of requestsDataSource.origRequests)
{
if (request.filter)
continue;
let filter = disabledMatcher.matchesAny(request.location, request.typeDescr, request.docDomain, request.thirdParty);
if (filter && !(filter.text in seenFilters))
{
this.disabledFilters.push(filter);
seenFilters[filter.text] = true;
}
}
// Find disabled subscriptions with filters matching any of the requests
let seenSubscriptions = Object.create(null);
- for each (let subscription in FilterStorage.subscriptions)
+ for (let subscription of FilterStorage.subscriptions)
{
if (!subscription.disabled)
continue;
disabledMatcher.clear();
- for each (let filter in subscription.filters)
+ for (let filter of subscription.filters)
if (filter instanceof BlockingFilter)
disabledMatcher.add(filter);
- for each (let request in requestsDataSource.origRequests)
+ for (let request of requestsDataSource.origRequests)
{
if (request.filter)
continue;
let filter = disabledMatcher.matchesAny(request.location, request.typeDescr, request.docDomain, request.thirdParty);
if (filter && !(subscription.url in seenSubscriptions))
{
this.disabledSubscriptions.push(subscription);
seenSubscriptions[subscription.text] = true;
break;
}
}
}
this.numSubscriptions = FilterStorage.subscriptions.filter(this.subscriptionFilter).length;
this.numAppliedFilters = 0;
- for each (let filter in filtersDataSource.origFilters)
+ for (let filter of filtersDataSource.origFilters)
{
if (filter instanceof WhitelistFilter)
continue;
this.numAppliedFilters++;
if (filter.subscriptions.some(function(subscription) subscription instanceof SpecialSubscription))
this.ownFilters.push(filter);
}
@@ -991,51 +991,51 @@ let issuesDataSource =
E("issuesNoFiltersBox").hidden = (type != "false positive" || this.numAppliedFilters > 0);
E("issuesNoSubscriptionsBox").hidden = (type != "false negative" || this.numAppliedFilters > 0 || this.numSubscriptions > 0);
E("issuesSubscriptionCountBox").hidden = (this.numSubscriptions < 5);
let ownFiltersBox = E("issuesOwnFilters");
if (this.ownFilters.length && !ownFiltersBox.firstChild)
{
let template = E("issuesOwnFiltersTemplate");
- for each (let filter in this.ownFilters)
+ for (let filter of this.ownFilters)
{
let element = template.cloneNode(true);
element.removeAttribute("id");
element.removeAttribute("hidden");
element.firstChild.setAttribute("value", filter.text);
element.firstChild.setAttribute("tooltiptext", filter.text);
element.abpFilter = filter;
ownFiltersBox.appendChild(element);
}
}
E("issuesOwnFiltersBox").hidden = (type != "false positive" || this.ownFilters.length == 0);
let disabledSubscriptionsBox = E("issuesDisabledSubscriptions");
if (this.disabledSubscriptions.length && !disabledSubscriptionsBox.firstChild)
{
let template = E("issuesDisabledSubscriptionsTemplate");
- for each (let subscription in this.disabledSubscriptions)
+ for (let subscription of this.disabledSubscriptions)
{
let element = template.cloneNode(true);
element.removeAttribute("id");
element.removeAttribute("hidden");
element.firstChild.setAttribute("value", subscription.title);
element.setAttribute("tooltiptext", subscription instanceof DownloadableSubscription ? subscription.url : subscription.title);
element.abpSubscription = subscription;
disabledSubscriptionsBox.appendChild(element);
}
}
E("issuesDisabledSubscriptionsBox").hidden = (type != "false negative" || this.disabledSubscriptions.length == 0);
let disabledFiltersBox = E("issuesDisabledFilters");
if (this.disabledFilters.length && !disabledFiltersBox.firstChild)
{
let template = E("issuesDisabledFiltersTemplate");
- for each (let filter in this.disabledFilters)
+ for (let filter of this.disabledFilters)
{
let element = template.cloneNode(true);
element.removeAttribute("id");
element.removeAttribute("hidden");
element.firstChild.setAttribute("value", filter.text);
element.setAttribute("tooltiptext", filter.text);
element.abpFilter = filter;
disabledFiltersBox.appendChild(element);
@@ -1114,17 +1114,17 @@ let issuesDataSource =
openDialog("subscriptionSelection.xul", "_blank", "chrome,centerscreen,modal,resizable,dialog=no", null, result);
if (!("url" in result))
return;
let subscriptionResults = [[result.url, result.title]];
if ("mainSubscriptionURL" in result)
subscriptionResults.push([result.mainSubscriptionURL, result.mainSubscriptionTitle]);
- for each (let [url, title] in subscriptionResults)
+ for (let [url, title] of subscriptionResults)
{
let subscription = Subscription.fromURL(url);
if (!subscription)
continue;
FilterStorage.addSubscription(subscription);
subscription.disabled = false;
« no previous file with comments | « chrome/content/ui/filters-subscriptionview.js ('k') | chrome/content/ui/sidebar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld