mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 09:20:06 +02:00
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:
parent
a23ce6b483
commit
886b256ada
6 changed files with 25 additions and 30 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue