Remove variable shadowing from the JavaScript files in the web/ folder

*This is part of a series of patches that will try to split PR 11566 into smaller chunks, to make reviewing more feasible.*

Once all the code has been fixed, we'll be able to eventually enable the ESLint `no-shadow` rule; see https://eslint.org/docs/rules/no-shadow
This commit is contained in:
Jonas Jenwald 2020-03-13 12:55:00 +01:00
parent a23ce6b483
commit 886b256ada
6 changed files with 25 additions and 30 deletions

View file

@ -277,7 +277,7 @@ class PDFFindController {
* the `matches` and keeps elements with a longer match length.
*/
_prepareMatches(matchesWithLength, matches, matchesLength) {
function isSubTerm(matchesWithLength, currentIndex) {
function isSubTerm(currentIndex) {
const currentElem = matchesWithLength[currentIndex];
const nextElem = matchesWithLength[currentIndex + 1];
@ -318,7 +318,7 @@ class PDFFindController {
: a.match - b.match;
});
for (let i = 0, len = matchesWithLength.length; i < len; i++) {
if (isSubTerm(matchesWithLength, i)) {
if (isSubTerm(i)) {
continue;
}
matches.push(matchesWithLength[i].match);