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

Side by Side Diff: chrome/content/ui/filters.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.
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 | « chrome/content/ui/composer.js ('k') | chrome/content/ui/filters-filterview.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 <https://adblockplus.org/>, 2 * This file is part of Adblock Plus <https://adblockplus.org/>,
3 * Copyright (C) 2006-2015 Eyeo GmbH 3 * Copyright (C) 2006-2015 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 let value = Cu.evalInSandbox(attribute.value.substr(1, len - 2), sandb ox); 140 let value = Cu.evalInSandbox(attribute.value.substr(1, len - 2), sandb ox);
141 if (attribute.name == "condition") 141 if (attribute.name == "condition")
142 value = value ? "true" : "false"; 142 value = value ? "true" : "false";
143 attribute.value = value; 143 attribute.value = value;
144 } 144 }
145 } 145 }
146 } 146 }
147 147
148 // Process <if> tags - remove if condition is false, replace by their childr en 148 // Process <if> tags - remove if condition is false, replace by their childr en
149 // if it is true 149 // if it is true
150 for each (let node in conditionals) 150 for (let node of conditionals)
151 { 151 {
152 let fragment = document.createDocumentFragment(); 152 let fragment = document.createDocumentFragment();
153 let condition = node.getAttribute("condition"); 153 let condition = node.getAttribute("condition");
154 if (condition == "false") 154 if (condition == "false")
155 condition = false; 155 condition = false;
156 for (let i = 0; i < node.childNodes.length; i++) 156 for (let i = 0; i < node.childNodes.length; i++)
157 { 157 {
158 let child = node.childNodes[i]; 158 let child = node.childNodes[i];
159 if (child.localName == "elif" || child.localName == "else") 159 if (child.localName == "elif" || child.localName == "else")
160 { 160 {
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 * data object. 217 * data object.
218 */ 218 */
219 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d ata) /**Node*/ 219 getNodeForData: function(/**Node*/ parent, /**String*/ property, /**Object*/ d ata) /**Node*/
220 { 220 {
221 for (let child = parent.firstChild; child; child = child.nextSibling) 221 for (let child = parent.firstChild; child; child = child.nextSibling)
222 if ("_data" in child && property in child._data && child._data[property] = = data) 222 if ("_data" in child && property in child._data && child._data[property] = = data)
223 return child; 223 return child;
224 return null; 224 return null;
225 } 225 }
226 }; 226 };
OLDNEW
« no previous file with comments | « chrome/content/ui/composer.js ('k') | chrome/content/ui/filters-filterview.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld