mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 14:48:08 +02:00
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
1 changed files with 5 additions and 2 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue