1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Whitelist closure related cases to address the remaining no-shadow linting errors

Given the way that "classes" were previously implemented in PDF.js, using regular functions and closures, there's a fair number of false positives when the `no-shadow` ESLint rule was enabled.

Note that while *some* of these `eslint-disable` statements can be removed if/when the relevant code is converted to proper `class`es, we'll probably never be able to get rid of all of them given our naming/coding conventions (however I don't really see this being a problem).
This commit is contained in:
Jonas Jenwald 2020-03-25 10:15:50 +01:00
parent 1d2f787d6a
commit dcb16af968
32 changed files with 109 additions and 0 deletions

View file

@ -1116,6 +1116,7 @@ class Catalog {
}
var XRef = (function XRefClosure() {
// eslint-disable-next-line no-shadow
function XRef(stream, pdfManager) {
this.stream = stream;
this.pdfManager = pdfManager;
@ -2089,6 +2090,7 @@ class NumberTree extends NameOrNumberTree {
* collections attributes and related files (/RF)
*/
var FileSpec = (function FileSpecClosure() {
// eslint-disable-next-line no-shadow
function FileSpec(root, xref) {
if (!root || !isDict(root)) {
return;
@ -2214,6 +2216,7 @@ const ObjectLoader = (function() {
}
}
// eslint-disable-next-line no-shadow
function ObjectLoader(dict, keys, xref) {
this.dict = dict;
this.keys = keys;