mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Enable the no-else-return
ESLint rule
Using `else` after `return` is not necessary, and can often lead to unnecessarily cluttered code. By using the `no-else-return` rule in ESLint we can avoid this pattern, see http://eslint.org/docs/rules/no-else-return.
This commit is contained in:
parent
049d7fa277
commit
4046d67fde
19 changed files with 67 additions and 79 deletions
|
@ -348,10 +348,9 @@ var CFFParser = (function CFFParserClosure() {
|
|||
return ((value - 247) * 256) + dict[pos++] + 108;
|
||||
} else if (value >= 251 && value <= 254) {
|
||||
return -((value - 251) * 256) - dict[pos++] - 108;
|
||||
} else {
|
||||
warn('CFFParser_parseDict: "' + value + '" is a reserved command.');
|
||||
return NaN;
|
||||
}
|
||||
warn('CFFParser_parseDict: "' + value + '" is a reserved command.');
|
||||
return NaN;
|
||||
}
|
||||
|
||||
function parseFloatOperand() {
|
||||
|
@ -1363,9 +1362,8 @@ var CFFCompiler = (function CFFCompilerClosure() {
|
|||
encodeNumber: function CFFCompiler_encodeNumber(value) {
|
||||
if (parseFloat(value) === parseInt(value, 10) && !isNaN(value)) { // isInt
|
||||
return this.encodeInteger(value);
|
||||
} else {
|
||||
return this.encodeFloat(value);
|
||||
}
|
||||
return this.encodeFloat(value);
|
||||
},
|
||||
encodeFloat: function CFFCompiler_encodeFloat(num) {
|
||||
var value = num.toString();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue