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
|
@ -55,7 +55,7 @@ var ARCFourCipher = (function ARCFourCipherClosure() {
|
|||
this.a = a;
|
||||
this.b = b;
|
||||
return output;
|
||||
}
|
||||
},
|
||||
};
|
||||
ARCFourCipher.prototype.decryptBlock = ARCFourCipher.prototype.encryptBlock;
|
||||
|
||||
|
@ -229,7 +229,7 @@ var Word64 = (function Word64Closure() {
|
|||
assign: function Word64_assign(word) {
|
||||
this.high = word.high;
|
||||
this.low = word.low;
|
||||
}
|
||||
},
|
||||
};
|
||||
return Word64;
|
||||
})();
|
||||
|
@ -623,7 +623,7 @@ var NullCipher = (function NullCipherClosure() {
|
|||
NullCipher.prototype = {
|
||||
decryptBlock: function NullCipher_decryptBlock(data) {
|
||||
return data;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return NullCipher;
|
||||
|
@ -1055,7 +1055,7 @@ var AES128Cipher = (function AES128CipherClosure() {
|
|||
output.set(result[i], j);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return AES128Cipher;
|
||||
|
@ -1487,7 +1487,7 @@ var AES256Cipher = (function AES256CipherClosure() {
|
|||
output.set(result[i], j);
|
||||
}
|
||||
return output;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return AES256Cipher;
|
||||
|
@ -1555,7 +1555,7 @@ var PDF17 = (function PDF17Closure() {
|
|||
return cipher.decryptBlock(userEncryption,
|
||||
false,
|
||||
new Uint8Array(16));
|
||||
}
|
||||
},
|
||||
};
|
||||
return PDF17;
|
||||
})();
|
||||
|
@ -1673,7 +1673,7 @@ var PDF20 = (function PDF20Closure() {
|
|||
return cipher.decryptBlock(userEncryption,
|
||||
false,
|
||||
new Uint8Array(16));
|
||||
}
|
||||
},
|
||||
};
|
||||
return PDF20;
|
||||
})();
|
||||
|
@ -1698,7 +1698,7 @@ var CipherTransform = (function CipherTransformClosure() {
|
|||
var data = stringToBytes(s);
|
||||
data = cipher.decryptBlock(data, true);
|
||||
return bytesToString(data);
|
||||
}
|
||||
},
|
||||
};
|
||||
return CipherTransform;
|
||||
})();
|
||||
|
@ -2042,7 +2042,7 @@ var CipherTransformFactory = (function CipherTransformFactoryClosure() {
|
|||
return new ARCFourCipher(key);
|
||||
};
|
||||
return new CipherTransform(cipherConstructor, cipherConstructor);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return CipherTransformFactory;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue