1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Enable the object-shorthand ESLint rule in src/shared

Please see http://eslint.org/docs/rules/object-shorthand.

For the most part, these changes are of the search-and-replace kind, and the previously enabled `no-undef` rule should complement the tests in helping ensure that no stupid errors crept into to the patch.
This commit is contained in:
Jonas Jenwald 2017-04-27 12:58:44 +02:00
parent f91d01cad3
commit afc74b0178
22 changed files with 195 additions and 198 deletions

View file

@ -870,36 +870,36 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
this.parts = [];
}
ExpressionBuilderVisitor.prototype = {
visitArgument: function (arg) {
visitArgument(arg) {
this.parts.push('Math.max(', arg.min, ', Math.min(',
arg.max, ', src[srcOffset + ', arg.index, ']))');
},
visitVariable: function (variable) {
visitVariable(variable) {
this.parts.push('v', variable.index);
},
visitLiteral: function (literal) {
visitLiteral(literal) {
this.parts.push(literal.number);
},
visitBinaryOperation: function (operation) {
visitBinaryOperation(operation) {
this.parts.push('(');
operation.arg1.visit(this);
this.parts.push(' ', operation.op, ' ');
operation.arg2.visit(this);
this.parts.push(')');
},
visitVariableDefinition: function (definition) {
visitVariableDefinition(definition) {
this.parts.push('var ');
definition.variable.visit(this);
this.parts.push(' = ');
definition.arg.visit(this);
this.parts.push(';');
},
visitMin: function (max) {
visitMin(max) {
this.parts.push('Math.min(');
max.arg.visit(this);
this.parts.push(', ', max.max, ')');
},
toString: function () {
toString() {
return this.parts.join('');
}
};