1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Enable the ESLint prefer-const rule globally (PR 11450 follow-up)

Please find additional details about the ESLint rule at https://eslint.org/docs/rules/prefer-const

With the recent introduction of Prettier this sort of mass enabling of ESLint rules becomes a lot easier, since the code will be automatically reformatted as necessary to account for e.g. changed line lengths.

Note that this patch is generated automatically, by using the ESLint `--fix` argument, and will thus require some additional clean-up (which is done separately).
This commit is contained in:
Jonas Jenwald 2020-01-24 09:48:21 +01:00
parent d2d9441373
commit 9e262ae7fa
54 changed files with 676 additions and 661 deletions

View file

@ -76,7 +76,7 @@ var Stream = (function StreamClosure() {
var strEnd = this.end;
if (!length) {
let subarray = bytes.subarray(pos, strEnd);
const subarray = bytes.subarray(pos, strEnd);
// `this.bytes` is always a `Uint8Array` here.
return forceClamped ? new Uint8ClampedArray(subarray) : subarray;
}
@ -85,7 +85,7 @@ var Stream = (function StreamClosure() {
end = strEnd;
}
this.pos = end;
let subarray = bytes.subarray(pos, end);
const subarray = bytes.subarray(pos, end);
// `this.bytes` is always a `Uint8Array` here.
return forceClamped ? new Uint8ClampedArray(subarray) : subarray;
},
@ -134,7 +134,7 @@ var Stream = (function StreamClosure() {
var StringStream = (function StringStreamClosure() {
function StringStream(str) {
let bytes = stringToBytes(str);
const bytes = stringToBytes(str);
Stream.call(this, bytes);
}
@ -235,7 +235,7 @@ var DecodeStream = (function DecodeStreamClosure() {
}
this.pos = end;
let subarray = this.buffer.subarray(pos, end);
const subarray = this.buffer.subarray(pos, end);
// `this.buffer` is either a `Uint8Array` or `Uint8ClampedArray` here.
return forceClamped && !(subarray instanceof Uint8ClampedArray)
? new Uint8ClampedArray(subarray)