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

Fix remaining linting errors, from enabling the prefer-const ESLint rule globally

This covers cases that the `--fix` command couldn't deal with, and in a few cases (notably `src/core/jbig2.js`) the code was changed to use block-scoped variables instead.
This commit is contained in:
Jonas Jenwald 2020-01-24 13:21:16 +01:00
parent 9e262ae7fa
commit 83bdb525a4
10 changed files with 76 additions and 109 deletions

View file

@ -67,9 +67,8 @@ class XMLParserBase {
}
_parseContent(s, start) {
let pos = start,
name,
attributes = [];
const attributes = [];
let pos = start;
function skipWs() {
while (pos < s.length && isWhitespace(s, pos)) {
@ -85,7 +84,7 @@ class XMLParserBase {
) {
++pos;
}
name = s.substring(start, pos);
const name = s.substring(start, pos);
skipWs();
while (
pos < s.length &&
@ -130,9 +129,7 @@ class XMLParserBase {
}
_parseProcessingInstruction(s, start) {
let pos = start,
name,
value;
let pos = start;
function skipWs() {
while (pos < s.length && isWhitespace(s, pos)) {
@ -148,13 +145,13 @@ class XMLParserBase {
) {
++pos;
}
name = s.substring(start, pos);
const name = s.substring(start, pos);
skipWs();
const attrStart = pos;
while (pos < s.length && (s[pos] !== "?" || s[pos + 1] !== ">")) {
++pos;
}
value = s.substring(attrStart, pos);
const value = s.substring(attrStart, pos);
return {
name,
value,