1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Enable the no-unused-vars ESLint rule

Please see http://eslint.org/docs/rules/no-unused-vars; note that this patch purposely uses the same rule options as in `mozilla-central`, such that it fixes part of issue 7957.

It wasn't, in my opinion, entirely straightforward to enable this rule compared to the already existing rules. In many cases a `var descriptiveName = ...` format was used (more or less) to document the code, and I choose to place the old variable name in a trailing comment to not lose that information.

I welcome feedback on these changes, since it wasn't always entirely easy to know what changes made the most sense in every situation.
This commit is contained in:
Jonas Jenwald 2017-01-19 14:00:36 +01:00
parent 8d684b5b3f
commit 52e0f51917
23 changed files with 37 additions and 85 deletions

View file

@ -785,7 +785,6 @@ var CFFParser = (function CFFParserClosure() {
var encoding = Object.create(null);
var bytes = this.bytes;
var predefined = false;
var hasSupplement = false;
var format, i, ii;
var raw = null;
@ -836,7 +835,7 @@ var CFFParser = (function CFFParserClosure() {
break;
}
var dataEnd = pos;
if (format & 0x80) {
if (format & 0x80) { // hasSupplement
// The font sanitizer does not support CFF encoding with a
// supplement, since the encoding is not really used to map
// between gid to glyph, let's overwrite what is declared in
@ -844,7 +843,6 @@ var CFFParser = (function CFFParserClosure() {
// StandardEncoding, that's a lie but that's ok.
bytes[dataStart] &= 0x7f;
readSupplement();
hasSupplement = true;
}
raw = bytes.subarray(dataStart, dataEnd);
}