Slightly re-factor the parameter handling in Catalog.parseDestDictionary
While it makes sense to check that the `destDict` parameter is indeed a Dictionary, since that data comes from the PDF document itself, the `resultObj` parameter is an internal PDF.js implementation detail that should always be correct (or tests will fail).
This commit is contained in:
parent
df9cce39c0
commit
b5b061cdb6
@ -1423,19 +1423,16 @@ class Catalog {
|
|||||||
* Helper function used to parse the contents of destination dictionaries.
|
* Helper function used to parse the contents of destination dictionaries.
|
||||||
* @param {ParseDestDictionaryParameters} params
|
* @param {ParseDestDictionaryParameters} params
|
||||||
*/
|
*/
|
||||||
static parseDestDictionary(params) {
|
static parseDestDictionary({
|
||||||
const destDict = params.destDict;
|
destDict,
|
||||||
|
resultObj,
|
||||||
|
docBaseUrl = null,
|
||||||
|
docAttachments = null,
|
||||||
|
}) {
|
||||||
if (!(destDict instanceof Dict)) {
|
if (!(destDict instanceof Dict)) {
|
||||||
warn("parseDestDictionary: `destDict` must be a dictionary.");
|
warn("parseDestDictionary: `destDict` must be a dictionary.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const resultObj = params.resultObj;
|
|
||||||
if (typeof resultObj !== "object") {
|
|
||||||
warn("parseDestDictionary: `resultObj` must be an object.");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const docBaseUrl = params.docBaseUrl || null;
|
|
||||||
const docAttachments = params.docAttachments || null;
|
|
||||||
|
|
||||||
let action = destDict.get("A"),
|
let action = destDict.get("A"),
|
||||||
url,
|
url,
|
||||||
|
Loading…
Reference in New Issue
Block a user