1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 15:32:28 +02:00

code review for 7d100f7b21: just the very slow opportunistic walk toward full ES6 code base

This commit is contained in:
Raymond Hill 2018-11-06 16:20:44 -02:00
parent 7d100f7b21
commit 835dcd41f2
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -764,9 +764,8 @@ var filterToDOMInterface = (function() {
return;
}
const out = [];
let iElem = elems.length;
while ( iElem-- ) {
out.push({ type: 'cosmetic', elem: elems[iElem]});
for ( const elem of elems ) {
out.push({ type: 'cosmetic', elem });
}
return out;
};
@ -1584,9 +1583,7 @@ var startPicker = function(details) {
const attr = srcAttrMap[tagName];
if ( attr === undefined ) { return; }
const elems = document.getElementsByTagName(tagName);
let i = elems.length;
while ( i-- ) {
const elem = elems[i];
for ( const elem of elems ) {
if ( elem === pickerRoot ) { continue; }
const src = elem[attr];
if ( typeof src !== 'string' ) { continue; }