Skip the PREFERENCE-branch in AppOptions.getAll
in official builds
Given that this branch is only necessary in development mode and *during* building, but is never actually used in the final viewer-bundles, we can utilize the pre-processor to ignore this code.
This commit is contained in:
parent
eebc230cf1
commit
ce9cfa2d72
@ -400,10 +400,13 @@ class AppOptions {
|
||||
for (const name in defaultOptions) {
|
||||
const defaultOption = defaultOptions[name];
|
||||
if (kind) {
|
||||
if ((kind & defaultOption.kind) === 0) {
|
||||
if (!(kind & defaultOption.kind)) {
|
||||
continue;
|
||||
}
|
||||
if (kind === OptionKind.PREFERENCE) {
|
||||
if (
|
||||
(typeof PDFJSDev === "undefined" || PDFJSDev.test("LIB")) &&
|
||||
kind === OptionKind.PREFERENCE
|
||||
) {
|
||||
if (defaultOption.kind & OptionKind.BROWSER) {
|
||||
throw new Error(`Invalid kind for preference: ${name}`);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user