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

@ -338,12 +338,12 @@ class PDFDocumentProperties {
};
let pageName = null;
let name =
let rawName =
getPageName(sizeInches, isPortrait, US_PAGE_NAMES) ||
getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES);
if (
!name &&
!rawName &&
!(
Number.isInteger(sizeMillimeters.width) &&
Number.isInteger(sizeMillimeters.height)
@ -366,8 +366,8 @@ class PDFDocumentProperties {
Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 &&
Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1
) {
name = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES);
if (name) {
rawName = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES);
if (rawName) {
// Update *both* sizes, computed above, to ensure that the displayed
// dimensions always correspond to the detected page name.
sizeInches = {
@ -378,11 +378,11 @@ class PDFDocumentProperties {
}
}
}
if (name) {
if (rawName) {
pageName = this.l10n.get(
"document_properties_page_size_name_" + name.toLowerCase(),
"document_properties_page_size_name_" + rawName.toLowerCase(),
null,
name
rawName
);
}