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

Side by Side Diff: lib/filterClasses.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/downloader.js ('k') | lib/filterListener.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 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
570 let domains = null; 570 let domains = null;
571 let siteKeys = null; 571 let siteKeys = null;
572 let thirdParty = null; 572 let thirdParty = null;
573 let collapse = null; 573 let collapse = null;
574 let options; 574 let options;
575 let match = (text.indexOf("$") >= 0 ? Filter.optionsRegExp.exec(text) : null); 575 let match = (text.indexOf("$") >= 0 ? Filter.optionsRegExp.exec(text) : null);
576 if (match) 576 if (match)
577 { 577 {
578 options = match[1].toUpperCase().split(","); 578 options = match[1].toUpperCase().split(",");
579 text = match.input.substr(0, match.index); 579 text = match.input.substr(0, match.index);
580 for each (let option in options) 580 for (let option of options)
581 { 581 {
582 let value = null; 582 let value = null;
583 let separatorIndex = option.indexOf("="); 583 let separatorIndex = option.indexOf("=");
584 if (separatorIndex >= 0) 584 if (separatorIndex >= 0)
585 { 585 {
586 value = option.substr(separatorIndex + 1); 586 value = option.substr(separatorIndex + 1);
587 option = option.substr(0, separatorIndex); 587 option = option.substr(0, separatorIndex);
588 } 588 }
589 option = option.replace(/-/, "_"); 589 option = option.replace(/-/, "_");
590 if (option in RegExpFilter.typeMap) 590 if (option in RegExpFilter.typeMap)
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 { 793 {
794 if (!selector) 794 if (!selector)
795 { 795 {
796 if (tagName == "*") 796 if (tagName == "*")
797 tagName = ""; 797 tagName = "";
798 798
799 let id = null; 799 let id = null;
800 let additional = ""; 800 let additional = "";
801 if (attrRules) { 801 if (attrRules) {
802 attrRules = attrRules.match(/\([\w\-]+(?:[$^*]?=[^\(\)"]*)?\)/g); 802 attrRules = attrRules.match(/\([\w\-]+(?:[$^*]?=[^\(\)"]*)?\)/g);
803 for each (let rule in attrRules) { 803 for (let rule of attrRules) {
804 rule = rule.substr(1, rule.length - 2); 804 rule = rule.substr(1, rule.length - 2);
805 let separatorPos = rule.indexOf("="); 805 let separatorPos = rule.indexOf("=");
806 if (separatorPos > 0) { 806 if (separatorPos > 0) {
807 rule = rule.replace(/=/, '="') + '"'; 807 rule = rule.replace(/=/, '="') + '"';
808 additional += "[" + rule + "]"; 808 additional += "[" + rule + "]";
809 } 809 }
810 else { 810 else {
811 if (id) 811 if (id)
812 { 812 {
813 let {Utils} = require("utils"); 813 let {Utils} = require("utils");
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
865 function ElemHideException(text, domains, selector) 865 function ElemHideException(text, domains, selector)
866 { 866 {
867 ElemHideBase.call(this, text, domains, selector); 867 ElemHideBase.call(this, text, domains, selector);
868 } 868 }
869 exports.ElemHideException = ElemHideException; 869 exports.ElemHideException = ElemHideException;
870 870
871 ElemHideException.prototype = 871 ElemHideException.prototype =
872 { 872 {
873 __proto__: ElemHideBase.prototype 873 __proto__: ElemHideBase.prototype
874 }; 874 };
OLDNEW
« no previous file with comments | « lib/downloader.js ('k') | lib/filterListener.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld