mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +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
|
@ -823,9 +823,8 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
this.handler);
|
||||
operatorList.addOp(fn, pattern.getIR());
|
||||
return Promise.resolve();
|
||||
} else {
|
||||
return Promise.reject('Unknown PatternType: ' + typeNum);
|
||||
}
|
||||
return Promise.reject('Unknown PatternType: ' + typeNum);
|
||||
}
|
||||
// TODO shall we fail here?
|
||||
operatorList.addOp(fn, args);
|
||||
|
@ -2902,18 +2901,17 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
|
|||
operation.fn = fn;
|
||||
operation.args = args;
|
||||
return true;
|
||||
} else {
|
||||
if (isEOF(obj)) {
|
||||
return false; // no more commands
|
||||
}
|
||||
// argument
|
||||
if (obj !== null) {
|
||||
if (args === null) {
|
||||
args = [];
|
||||
}
|
||||
args.push(obj);
|
||||
assert(args.length <= 33, 'Too many arguments');
|
||||
}
|
||||
if (isEOF(obj)) {
|
||||
return false; // no more commands
|
||||
}
|
||||
// argument
|
||||
if (obj !== null) {
|
||||
if (args === null) {
|
||||
args = [];
|
||||
}
|
||||
args.push(obj);
|
||||
assert(args.length <= 33, 'Too many arguments');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue