1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-21 07:38: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

@ -673,3 +673,5 @@ var Driver = (function DriverClosure() {
return Driver;
})();
exports.Driver = Driver;

View file

@ -88,3 +88,7 @@ function verifyTtxOutput(output) {
throw m[1];
}
}
exports.decodeFontData = decodeFontData;
exports.ttx = ttx;
exports.verifyTtxOutput = verifyTtxOutput;

View file

@ -189,7 +189,7 @@ describe('CFFParser', function() {
it('parses a CharString endchar with 4 args w/seac enabled', function() {
var parser = new CFFParser(fontData, {},
/* seacAnalysisEnabled = */ true);
var cff = parser.parse();
parser.parse(); // cff
var bytes = new Uint8Array([0, 1, // count
1, // offsetSize
@ -211,7 +211,7 @@ describe('CFFParser', function() {
it('parses a CharString endchar with 4 args w/seac disabled', function() {
var parser = new CFFParser(fontData, {},
/* seacAnalysisEnabled = */ false);
var cff = parser.parse();
parser.parse(); // cff
var bytes = new Uint8Array([0, 1, // count
1, // offsetSize

View file

@ -40,8 +40,6 @@
'use strict';
var pdfjsLibs;
function initializePDFJS(callback) {
require.config({paths: {'pdfjs': '../../src', 'pdfjs-web': '../../web',
'pdfjs-test': '..'}});

View file

@ -63,7 +63,7 @@ describe('network', function() {
});
};
var readPromise = read();
var readPromise = Promise.all([read(), promise]);
readPromise.then(function (page) {
expect(len).toEqual(pdf1Length);
@ -117,12 +117,13 @@ describe('network', function() {
});
};
var readPromise = read();
var readPromise = Promise.all([read(), promise]);
readPromise.then(function () {
expect(len).toEqual(pdf2Length);
expect(count).toBeGreaterThan(1);
expect(isStreamingSupported).toEqual(true);
expect(isRangeSupported).toEqual(true);
done();
}).catch(function (reason) {
done.fail(reason);
@ -179,6 +180,7 @@ describe('network', function() {
readPromises.then(function () {
expect(result1.value).toEqual(rangeSize);
expect(result2.value).toEqual(tailSize);
expect(isStreamingSupported).toEqual(false);
expect(isRangeSupported).toEqual(true);
expect(fullReaderCancelled).toEqual(true);
done();

View file

@ -74,3 +74,5 @@ var TestReporter = function(browser, appPath) {
setTimeout(sendQuitRequest, 500);
};
};
exports.TestReporter = TestReporter;