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

@ -168,6 +168,7 @@ function addContextCurrentTransform(ctx) {
}
var CachedCanvases = (function CachedCanvasesClosure() {
// eslint-disable-next-line no-shadow
function CachedCanvases(canvasFactory) {
this.canvasFactory = canvasFactory;
this.cache = Object.create(null);
@ -383,6 +384,7 @@ function compileType3Glyph(imgData) {
}
var CanvasExtraState = (function CanvasExtraStateClosure() {
// eslint-disable-next-line no-shadow
function CanvasExtraState() {
// Are soft masks and alpha values shapes or opacities?
this.alphaIsShape = false;
@ -435,6 +437,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
// Defines the number of steps before checking the execution time
var EXECUTION_STEPS = 10;
// eslint-disable-next-line no-shadow
function CanvasGraphics(
canvasCtx,
commonObjs,