mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Add basic validation of the AppOptions BROWSER
-kind
This commit is contained in:
parent
7bd920691f
commit
26989fdf24
1 changed files with 9 additions and 0 deletions
|
@ -477,6 +477,15 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("TESTING || LIB")) {
|
||||||
) {
|
) {
|
||||||
throw new Error(`Invalid value for "PREFERENCE" kind: ${name}`);
|
throw new Error(`Invalid value for "PREFERENCE" kind: ${name}`);
|
||||||
}
|
}
|
||||||
|
} else if (kind & OptionKind.BROWSER) {
|
||||||
|
if (typeof compatParams === "object" && compatParams.has(name)) {
|
||||||
|
throw new Error(
|
||||||
|
`Should not have compatibility-value for "BROWSER" kind: ${name}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (value === undefined) {
|
||||||
|
throw new Error(`Invalid value for "BROWSER" kind: ${name}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue