mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 09:38:06 +02:00
Fix inconsistent spacing and trailing commas in objects in src/core/
files, so we can enable the comma-dangle
and object-curly-spacing
ESLint rules later on
*Unfortunately this patch is fairly big, even though it only covers the `src/core` folder, but splitting it even further seemed difficult.* http://eslint.org/docs/rules/comma-dangle http://eslint.org/docs/rules/object-curly-spacing Given that we currently have quite inconsistent object formatting, fixing this in *one* big patch probably wouldn't be feasible (since I cannot imagine anyone wanting to review that); hence I've opted to try and do this piecewise instead. Please note: This patch was created automatically, using the ESLint --fix command line option. In a couple of places this caused lines to become too long, and I've fixed those manually; please refer to the interdiff below for the only hand-edits in this patch. ```diff diff --git a/src/core/evaluator.js b/src/core/evaluator.js index abab9027..dcd3594b 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -2785,7 +2785,8 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() { t['Tz'] = { id: OPS.setHScale, numArgs: 1, variableArgs: false, }; t['TL'] = { id: OPS.setLeading, numArgs: 1, variableArgs: false, }; t['Tf'] = { id: OPS.setFont, numArgs: 2, variableArgs: false, }; - t['Tr'] = { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false, }; + t['Tr'] = { id: OPS.setTextRenderingMode, numArgs: 1, + variableArgs: false, }; t['Ts'] = { id: OPS.setTextRise, numArgs: 1, variableArgs: false, }; t['Td'] = { id: OPS.moveText, numArgs: 2, variableArgs: false, }; t['TD'] = { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false, }; diff --git a/src/core/jbig2.js b/src/core/jbig2.js index 5a17d482..71671541 100644 --- a/src/core/jbig2.js +++ b/src/core/jbig2.js @@ -123,19 +123,22 @@ var Jbig2Image = (function Jbig2ImageClosure() { { x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, { x: -2, y: 0, }, { x: -1, y: 0, }], [{ x: -3, y: -1, }, { x: -2, y: -1, }, { x: -1, y: -1, }, { x: 0, y: -1, }, - { x: 1, y: -1, }, { x: -4, y: 0, }, { x: -3, y: 0, }, { x: -2, y: 0, }, { x: -1, y: 0, }] + { x: 1, y: -1, }, { x: -4, y: 0, }, { x: -3, y: 0, }, { x: -2, y: 0, }, + { x: -1, y: 0, }] ]; var RefinementTemplates = [ { coding: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }], - reference: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }, { x: 0, y: 0, }, - { x: 1, y: 0, }, { x: -1, y: 1, }, { x: 0, y: 1, }, { x: 1, y: 1, }], + reference: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }, + { x: 0, y: 0, }, { x: 1, y: 0, }, { x: -1, y: 1, }, + { x: 0, y: 1, }, { x: 1, y: 1, }], }, { - coding: [{ x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }], - reference: [{ x: 0, y: -1, }, { x: -1, y: 0, }, { x: 0, y: 0, }, { x: 1, y: 0, }, - { x: 0, y: 1, }, { x: 1, y: 1, }], + coding: [{ x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, + { x: -1, y: 0, }], + reference: [{ x: 0, y: -1, }, { x: -1, y: 0, }, { x: 0, y: 0, }, + { x: 1, y: 0, }, { x: 0, y: 1, }, { x: 1, y: 1, }], } ]; ```
This commit is contained in:
parent
593dec1bb7
commit
a8c87f8019
29 changed files with 586 additions and 582 deletions
|
@ -245,7 +245,7 @@ var DecodeStream = (function DecodeStreamClosure() {
|
|||
return this.str.getBaseStreams();
|
||||
}
|
||||
return [];
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return DecodeStream;
|
||||
|
@ -892,7 +892,7 @@ var JpegStream = (function JpegStreamClosure() {
|
|||
// If this.maybeLength is null, we'll get the entire stream.
|
||||
return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength));
|
||||
},
|
||||
configurable: true
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
JpegStream.prototype.ensureBuffer = function JpegStream_ensureBuffer(req) {
|
||||
|
@ -969,7 +969,7 @@ var JpxStream = (function JpxStreamClosure() {
|
|||
// If this.maybeLength is null, we'll get the entire stream.
|
||||
return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength));
|
||||
},
|
||||
configurable: true
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
JpxStream.prototype.ensureBuffer = function JpxStream_ensureBuffer(req) {
|
||||
|
@ -1039,7 +1039,7 @@ var Jbig2Stream = (function Jbig2StreamClosure() {
|
|||
// If this.maybeLength is null, we'll get the entire stream.
|
||||
return shadow(this, 'bytes', this.stream.getBytes(this.maybeLength));
|
||||
},
|
||||
configurable: true
|
||||
configurable: true,
|
||||
});
|
||||
|
||||
Jbig2Stream.prototype.ensureBuffer = function Jbig2Stream_ensureBuffer(req) {
|
||||
|
@ -1054,10 +1054,10 @@ var Jbig2Stream = (function Jbig2StreamClosure() {
|
|||
var globalsStream = this.params.get('JBIG2Globals');
|
||||
if (isStream(globalsStream)) {
|
||||
var globals = globalsStream.getBytes();
|
||||
chunks.push({data: globals, start: 0, end: globals.length});
|
||||
chunks.push({ data: globals, start: 0, end: globals.length, });
|
||||
}
|
||||
}
|
||||
chunks.push({data: this.bytes, start: 0, end: this.bytes.length});
|
||||
chunks.push({ data: this.bytes, start: 0, end: this.bytes.length, });
|
||||
var data = jbig2Image.parseChunks(chunks);
|
||||
var dataLength = data.length;
|
||||
|
||||
|
@ -2326,7 +2326,7 @@ var LZWStream = (function LZWStreamClosure() {
|
|||
dictionaryLengths: new Uint16Array(maxLzwDictionarySize),
|
||||
dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),
|
||||
currentSequence: new Uint8Array(maxLzwDictionarySize),
|
||||
currentSequenceLength: 0
|
||||
currentSequenceLength: 0,
|
||||
};
|
||||
for (var i = 0; i < 256; ++i) {
|
||||
lzwState.dictionaryValues[i] = i;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue