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.
This commit is contained in:
Jonas Jenwald 2022-05-03 11:21:33 +02:00
parent 7df47c289f
commit d4fe4fd97b

View File

@ -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" ||