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

Side by Side Diff: lib/synchronizer.js

Issue 6341149593698304: Issue 301 - Change for each to for .. of .. in lib/ (Closed)
Patch Set: Created April 10, 2014, 5:02 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/sync.js ('k') | lib/ui.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * This file is part of Adblock Plus <http://adblockplus.org/>, 2 * This file is part of Adblock Plus <http://adblockplus.org/>,
3 * Copyright (C) 2006-2014 Eyeo GmbH 3 * Copyright (C) 2006-2014 Eyeo GmbH
4 * 4 *
5 * Adblock Plus is free software: you can redistribute it and/or modify 5 * Adblock Plus is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 3 as 6 * it under the terms of the GNU General Public License version 3 as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
8 * 8 *
9 * Adblock Plus is distributed in the hope that it will be useful, 9 * Adblock Plus is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 }, 91 },
92 92
93 /** 93 /**
94 * Yields Downloadable instances for all subscriptions that can be downloaded. 94 * Yields Downloadable instances for all subscriptions that can be downloaded.
95 */ 95 */
96 _getDownloadables: function() 96 _getDownloadables: function()
97 { 97 {
98 if (!Prefs.subscriptions_autoupdate) 98 if (!Prefs.subscriptions_autoupdate)
99 return; 99 return;
100 100
101 for each (let subscription in FilterStorage.subscriptions) 101 for (let subscription of FilterStorage.subscriptions)
102 { 102 {
103 if (subscription instanceof DownloadableSubscription) 103 if (subscription instanceof DownloadableSubscription)
104 yield this._getDownloadable(subscription, false); 104 yield this._getDownloadable(subscription, false);
105 } 105 }
106 }, 106 },
107 107
108 /** 108 /**
109 * Creates a Downloadable instance for a subscription. 109 * Creates a Downloadable instance for a subscription.
110 */ 110 */
111 _getDownloadable: function(/**Subscription*/ subscription, /**Boolean*/ manual ) /**Downloadable*/ 111 _getDownloadable: function(/**Subscription*/ subscription, /**Boolean*/ manual ) /**Downloadable*/
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 { 248 {
249 let {addonVersion} = require("info"); 249 let {addonVersion} = require("info");
250 subscription.requiredVersion = minVersion; 250 subscription.requiredVersion = minVersion;
251 if (Services.vc.compare(minVersion, addonVersion) > 0) 251 if (Services.vc.compare(minVersion, addonVersion) > 0)
252 subscription.upgradeRequired = true; 252 subscription.upgradeRequired = true;
253 } 253 }
254 254
255 // Process filters 255 // Process filters
256 lines.shift(); 256 lines.shift();
257 let filters = []; 257 let filters = [];
258 for each (let line in lines) 258 for (let line of lines)
259 { 259 {
260 line = Filter.normalize(line); 260 line = Filter.normalize(line);
261 if (line) 261 if (line)
262 filters.push(Filter.fromText(line)); 262 filters.push(Filter.fromText(line));
263 } 263 }
264 264
265 FilterStorage.updateSubscriptionFilters(subscription, filters); 265 FilterStorage.updateSubscriptionFilters(subscription, filters);
266 266
267 return undefined; 267 return undefined;
268 }, 268 },
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 let data = "[Adblock]\n" + subscription.filters.map(function(f) f.te xt).join("\n"); 314 let data = "[Adblock]\n" + subscription.filters.map(function(f) f.te xt).join("\n");
315 redirectCallback("data:text/plain," + encodeURIComponent(data)); 315 redirectCallback("data:text/plain," + encodeURIComponent(data));
316 } 316 }
317 }, false); 317 }, false);
318 request.send(null); 318 request.send(null);
319 } 319 }
320 } 320 }
321 }, 321 },
322 }; 322 };
323 Synchronizer.init(); 323 Synchronizer.init();
OLDNEW
« no previous file with comments | « lib/sync.js ('k') | lib/ui.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld