Simplify setting the GlobalWorkerOptions
default values (PR 9480 follow-up)
There's really no need for these "complicated" default value assignments, since `GlobalWorkerOptions` is a local variable at this point, and this is rather a case of too much copy-and-paste.
Note that years ago, when all options were set using a global `PDFJS` object, it's possible that options had been set (from the outside) *before* the object had been properly initialized; see e.g. a89071bdef/src/display/global.js
This commit is contained in:
parent
1b1ebf6a77
commit
1c4af2727c
@ -27,14 +27,7 @@
|
||||
/** @type {GlobalWorkerOptionsType} */
|
||||
const GlobalWorkerOptions = Object.create(null);
|
||||
|
||||
GlobalWorkerOptions.workerPort =
|
||||
GlobalWorkerOptions.workerPort === undefined
|
||||
? null
|
||||
: GlobalWorkerOptions.workerPort;
|
||||
|
||||
GlobalWorkerOptions.workerSrc =
|
||||
GlobalWorkerOptions.workerSrc === undefined
|
||||
? ""
|
||||
: GlobalWorkerOptions.workerSrc;
|
||||
GlobalWorkerOptions.workerPort = null;
|
||||
GlobalWorkerOptions.workerSrc = "";
|
||||
|
||||
export { GlobalWorkerOptions };
|
||||
|
Loading…
Reference in New Issue
Block a user