1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

Account for formatting changes in Prettier version 2.3.0

With the exception of one tweaked `eslint-disable` comment, in `web/generic_scripting.js`, this patch was generated automatically using `gulp lint --fix`.

Please find additional information at:
 - https://github.com/prettier/prettier/releases/tag/2.3.0
 - https://prettier.io/blog/2021/05/09/2.3.0.html
This commit is contained in:
Jonas Jenwald 2021-05-16 10:58:34 +02:00
parent 30908451b4
commit 8943bcd3c3
28 changed files with 127 additions and 192 deletions

View file

@ -26,7 +26,8 @@ function rewriteWebArchiveUrl(url) {
// Web Archive URLs need to be transformed to add `if_` after the ID.
// Without this, an HTML page containing an iframe with the PDF file
// will be served instead (issue 8920).
var webArchiveRegex = /(^https?:\/\/web\.archive\.org\/web\/)(\d+)(\/https?:\/\/.+)/g;
var webArchiveRegex =
/(^https?:\/\/web\.archive\.org\/web\/)(\d+)(\/https?:\/\/.+)/g;
var urlParts = webArchiveRegex.exec(url);
if (urlParts) {
return urlParts[1] + (urlParts[2] + "if_") + urlParts[3];

View file

@ -422,7 +422,8 @@ var Driver = (function DriverClosure() {
loadingTask.promise.then(
doc => {
task.pdfDoc = doc;
task.optionalContentConfigPromise = doc.getOptionalContentConfig();
task.optionalContentConfigPromise =
doc.getOptionalContentConfig();
this._nextPage(task, failure);
},
@ -600,9 +601,8 @@ var Driver = (function DriverClosure() {
}
annotationLayerCanvas.width = viewport.width;
annotationLayerCanvas.height = viewport.height;
var annotationLayerContext = annotationLayerCanvas.getContext(
"2d"
);
var annotationLayerContext =
annotationLayerCanvas.getContext("2d");
annotationLayerContext.clearRect(
0,
0,

View file

@ -843,8 +843,8 @@ function unitTestPostHandler(req, res) {
}
async function startBrowser(browserName, startUrl = "") {
const revisions = require("puppeteer/lib/cjs/puppeteer/revisions.js")
.PUPPETEER_REVISIONS;
const revisions =
require("puppeteer/lib/cjs/puppeteer/revisions.js").PUPPETEER_REVISIONS;
const wantedRevision =
browserName === "chrome" ? revisions.chromium : revisions.firefox;

View file

@ -230,24 +230,10 @@ describe("annotation", function () {
it("should process quadpoints in the standard order", function () {
rect = [10, 10, 20, 20];
dict.set("QuadPoints", [
10,
20,
20,
20,
10,
10,
20,
10,
11,
19,
19,
19,
11,
11,
19,
11,
]);
dict.set(
"QuadPoints",
[10, 20, 20, 20, 10, 10, 20, 10, 11, 19, 19, 19, 11, 11, 19, 11]
);
expect(getQuadPoints(dict, rect)).toEqual([
[
{ x: 10, y: 20 },

View file

@ -1066,12 +1066,8 @@ describe("api", function () {
});
it("gets metadata", async function () {
const {
info,
metadata,
contentDispositionFilename,
contentLength,
} = await pdfDocument.getMetadata();
const { info, metadata, contentDispositionFilename, contentLength } =
await pdfDocument.getMetadata();
expect(info.Title).toEqual("Basic API Test");
// Custom, non-standard, information dictionary entries.
@ -1096,12 +1092,8 @@ describe("api", function () {
buildGetDocumentParams("tracemonkey.pdf")
);
const pdfDoc = await loadingTask.promise;
const {
info,
metadata,
contentDispositionFilename,
contentLength,
} = await pdfDoc.getMetadata();
const { info, metadata, contentDispositionFilename, contentLength } =
await pdfDoc.getMetadata();
expect(info.Creator).toEqual("TeX");
expect(info.Producer).toEqual("pdfeTeX-1.21a");
@ -1132,12 +1124,8 @@ describe("api", function () {
it("gets metadata, with missing PDF header (bug 1606566)", async function () {
const loadingTask = getDocument(buildGetDocumentParams("bug1606566.pdf"));
const pdfDoc = await loadingTask.promise;
const {
info,
metadata,
contentDispositionFilename,
contentLength,
} = await pdfDoc.getMetadata();
const { info, metadata, contentDispositionFilename, contentLength } =
await pdfDoc.getMetadata();
// The following are PDF.js specific, non-standard, properties.
expect(info.PDFFormatVersion).toEqual(null);
@ -1445,13 +1433,12 @@ describe("api", function () {
docBaseUrl: "qwerty.pdf",
})
);
const invalidDocBaseUrlPromise = invalidDocBaseUrlLoadingTask.promise.then(
function (pdfDoc) {
const invalidDocBaseUrlPromise =
invalidDocBaseUrlLoadingTask.promise.then(function (pdfDoc) {
return pdfDoc.getPage(1).then(function (pdfPage) {
return pdfPage.getAnnotations();
});
}
);
});
const [
defaultAnnotations,
@ -1804,7 +1791,8 @@ describe("api", function () {
});
it("multiple render() on the same canvas", async function () {
const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();
const optionalContentConfigPromise =
pdfDocument.getOptionalContentConfig();
const viewport = page.getViewport({ scale: 1 });
const canvasAndCtx = CanvasFactory.create(

View file

@ -27,9 +27,8 @@ function getTopLeftPixel(canvasContext) {
}
describe("custom canvas rendering", function () {
const transparentGetDocumentParams = buildGetDocumentParams(
"transparent.pdf"
);
const transparentGetDocumentParams =
buildGetDocumentParams("transparent.pdf");
let CanvasFactory;
let loadingTask;