From d4fe4fd97b88d8e12d51ef77b5b2fbcd59f1b02b Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Tue, 3 May 2022 11:21:33 +0200 Subject: [PATCH] Simplify a couple of `isNodeJS`-dependent `getDocument` default values Given that the `isNodeJS`-constant will, after PR 14858, *always* be `false` in non-GENERIC builds we can simplify a couple of `getDocument`-parameter default values slightly. The old format, with inline `PDFJSDev`-checks, wasn't exactly a wonder of readability; which was my fault. --- src/display/api.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/display/api.js b/src/display/api.js index e952eb125..422055740 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -353,15 +353,10 @@ function getDocument(src) { params.isEvalSupported = true; } if (typeof params.disableFontFace !== "boolean") { - params.disableFontFace = - (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) && isNodeJS; + params.disableFontFace = isNodeJS; } if (typeof params.useSystemFonts !== "boolean") { - params.useSystemFonts = - !( - (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) && - isNodeJS - ) && !params.disableFontFace; + params.useSystemFonts = !isNodeJS && !params.disableFontFace; } if ( typeof params.ownerDocument !== "object" ||