mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +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:
parent
8d684b5b3f
commit
52e0f51917
23 changed files with 37 additions and 85 deletions
|
@ -432,14 +432,12 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
|||
var deltaHeight = decodeInteger(contextCache, 'IADH', decoder); // 6.5.6
|
||||
currentHeight += deltaHeight;
|
||||
var currentWidth = 0;
|
||||
var totalWidth = 0;
|
||||
while (true) {
|
||||
var deltaWidth = decodeInteger(contextCache, 'IADW', decoder); // 6.5.7
|
||||
if (deltaWidth === null) {
|
||||
break; // OOB
|
||||
}
|
||||
currentWidth += deltaWidth;
|
||||
totalWidth += currentWidth;
|
||||
var bitmap;
|
||||
if (refinement) {
|
||||
// 6.5.8.2 Refinement/aggregate-coded symbol bitmap
|
||||
|
@ -889,7 +887,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
|||
delete pageInfo.height;
|
||||
}
|
||||
var pageSegmentFlags = data[position + 16];
|
||||
var pageStripingInformation = readUint16(data, position + 17);
|
||||
readUint16(data, position + 17); // pageStripingInformation
|
||||
pageInfo.lossless = !!(pageSegmentFlags & 1);
|
||||
pageInfo.refinement = !!(pageSegmentFlags & 2);
|
||||
pageInfo.defaultPixelValue = (pageSegmentFlags >> 2) & 1;
|
||||
|
@ -923,7 +921,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
|||
}
|
||||
}
|
||||
|
||||
function parseJbig2(data, start, end) {
|
||||
function parseJbig2(data, start, end) { // eslint-disable-line no-unused-vars
|
||||
var position = start;
|
||||
if (data[position] !== 0x97 || data[position + 1] !== 0x4A ||
|
||||
data[position + 2] !== 0x42 || data[position + 3] !== 0x32 ||
|
||||
|
@ -939,7 +937,7 @@ var Jbig2Image = (function Jbig2ImageClosure() {
|
|||
header.numberOfPages = readUint32(data, position);
|
||||
position += 4;
|
||||
}
|
||||
var segments = readSegments(header, data, position, end);
|
||||
readSegments(header, data, position, end); // segments
|
||||
error('Not implemented');
|
||||
// processSegments(segments, new SimpleSegmentVisitor());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue