Skip to content

Commit 99b6d3e

Browse files
committed
Fix a few *safe* ESLint no-var failures (13371 follow-up)
As can be seen in PR 13371, some of the `no-var` changes in the `PartialEvaluator.{getOperatorList, getTextContent}` methods caused errors in `gulp server`-mode. However, there's a handful of instances of `var` in other methods which should be completely *safe* to convert since there's no strange scope-issues present in that code.
1 parent a5c74f5 commit 99b6d3e

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

src/core/evaluator.js

+10-9
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,8 @@ class PartialEvaluator {
394394
} else {
395395
bbox = null;
396396
}
397-
let optionalContent = null;
397+
let optionalContent = null,
398+
groupOptions;
398399
if (dict.has("OC")) {
399400
optionalContent = await this.parseMarkedContentProps(
400401
dict.get("OC"),
@@ -404,7 +405,7 @@ class PartialEvaluator {
404405
}
405406
const group = dict.get("Group");
406407
if (group) {
407-
var groupOptions = {
408+
groupOptions = {
408409
matrix,
409410
bbox,
410411
smask,
@@ -3766,7 +3767,7 @@ class PartialEvaluator {
37663767
throw new FormatError("invalid font name");
37673768
}
37683769

3769-
let fontFile;
3770+
let fontFile, subtype, length1, length2, length3;
37703771
try {
37713772
fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3");
37723773
} catch (ex) {
@@ -3778,13 +3779,13 @@ class PartialEvaluator {
37783779
}
37793780
if (fontFile) {
37803781
if (fontFile.dict) {
3781-
var subtype = fontFile.dict.get("Subtype");
3782-
if (subtype) {
3783-
subtype = subtype.name;
3782+
const subtypeEntry = fontFile.dict.get("Subtype");
3783+
if (subtypeEntry instanceof Name) {
3784+
subtype = subtypeEntry.name;
37843785
}
3785-
var length1 = fontFile.dict.get("Length1");
3786-
var length2 = fontFile.dict.get("Length2");
3787-
var length3 = fontFile.dict.get("Length3");
3786+
length1 = fontFile.dict.get("Length1");
3787+
length2 = fontFile.dict.get("Length2");
3788+
length3 = fontFile.dict.get("Length3");
37883789
}
37893790
}
37903791

0 commit comments

Comments
 (0)