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

Update Prettier to version 2.0

Please note that these changes were done automatically, using `gulp lint --fix`.

Given that the major version number was increased, there's a fair number of (primarily whitespace) changes; please see https://prettier.io/blog/2020/03/21/2.0.0.html
In order to reduce the size of these changes somewhat, this patch maintains the old "arrowParens" style for now (once mozilla-central updates Prettier we can simply choose the same formatting, assuming it will differ here).
This commit is contained in:
Jonas Jenwald 2020-04-14 12:28:14 +02:00
parent a4dd081d7b
commit 426945b480
145 changed files with 2005 additions and 2009 deletions

View file

@ -159,7 +159,7 @@ var PDFFunction = (function PDFFunctionClosure() {
this.parse({ xref, isEvalSupported, fn: xref.fetchIfRef(fnObj[j]) })
);
}
return function(src, srcOffset, dest, destOffset) {
return function (src, srcOffset, dest, destOffset) {
for (var i = 0, ii = fnArray.length; i < ii; i++) {
fnArray[i](src, srcOffset, dest, destOffset + i);
}
@ -873,7 +873,7 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
function AstNode(type) {
this.type = type;
}
AstNode.prototype.visit = function(visitor) {
AstNode.prototype.visit = function (visitor) {
unreachable("abstract method");
};
@ -884,7 +884,7 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
this.max = max;
}
AstArgument.prototype = Object.create(AstNode.prototype);
AstArgument.prototype.visit = function(visitor) {
AstArgument.prototype.visit = function (visitor) {
visitor.visitArgument(this);
};
@ -895,7 +895,7 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
this.max = number;
}
AstLiteral.prototype = Object.create(AstNode.prototype);
AstLiteral.prototype.visit = function(visitor) {
AstLiteral.prototype.visit = function (visitor) {
visitor.visitLiteral(this);
};
@ -908,7 +908,7 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
this.max = max;
}
AstBinaryOperation.prototype = Object.create(AstNode.prototype);
AstBinaryOperation.prototype.visit = function(visitor) {
AstBinaryOperation.prototype.visit = function (visitor) {
visitor.visitBinaryOperation(this);
};
@ -919,7 +919,7 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
this.max = max;
}
AstMin.prototype = Object.create(AstNode.prototype);
AstMin.prototype.visit = function(visitor) {
AstMin.prototype.visit = function (visitor) {
visitor.visitMin(this);
};
@ -930,7 +930,7 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
this.max = max;
}
AstVariable.prototype = Object.create(AstNode.prototype);
AstVariable.prototype.visit = function(visitor) {
AstVariable.prototype.visit = function (visitor) {
visitor.visitVariable(this);
};
@ -940,7 +940,7 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
this.arg = arg;
}
AstVariableDefinition.prototype = Object.create(AstNode.prototype);
AstVariableDefinition.prototype.visit = function(visitor) {
AstVariableDefinition.prototype.visit = function (visitor) {
visitor.visitVariableDefinition(this);
};
@ -1245,12 +1245,12 @@ var PostScriptCompiler = (function PostScriptCompilerClosure() {
}
var result = [];
instructions.forEach(function(instruction) {
instructions.forEach(function (instruction) {
var statementBuilder = new ExpressionBuilderVisitor();
instruction.visit(statementBuilder);
result.push(statementBuilder.toString());
});
stack.forEach(function(expr, i) {
stack.forEach(function (expr, i) {
var statementBuilder = new ExpressionBuilderVisitor();
expr.visit(statementBuilder);
var min = range[i * 2],