Skip to content

Commit b3e1680

Browse files
committed
Remove the BasePdfManager.prototype.catalog getter
This is only invoked *once* and it can be trivially replaced by the `ensureCatalog`-method, since the code where it's used is already asynchronous.
1 parent 91bfe12 commit b3e1680

2 files changed

Lines changed: 1 addition & 5 deletions

File tree

src/core/pdf_manager.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,6 @@ class BasePdfManager {
9595
return this._docBaseUrl;
9696
}
9797

98-
get catalog() {
99-
return this.pdfDocument.catalog;
100-
}
101-
10298
ensureDoc(prop, args) {
10399
return this.ensure(this.pdfDocument, prop, args);
104100
}

src/core/struct_tree.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ class StructTreeRoot {
118118
pdfManager,
119119
changes,
120120
}) {
121-
const root = pdfManager.catalog.cloneDict();
121+
const root = await pdfManager.ensureCatalog("cloneDict");
122122
const cache = new RefSetCache();
123123
cache.put(catalogRef, root);
124124

0 commit comments

Comments
 (0)