Skip to content

Commit 0a91764

Browse files
committed
Remove Object.hasOwn usage from the src/core/xref.js file
This should not be necessary, given the following checks done early during the worker initialization: https://github.com/mozilla/pdf.js/blob/c5746949acd8d64636683c2da733e5426535728e/src/core/worker.js#L124-L141
1 parent c574694 commit 0a91764

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/core/xref.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -683,10 +683,10 @@ class XRef {
683683
// iterate over empty entries so we use the `in` operator instead of
684684
// using for..of on entries() or a for with the array length.
685685
for (const num in this.entries) {
686-
if (!Object.hasOwn(this.entries, num)) {
686+
const entry = this.entries[num];
687+
if (!entry) {
687688
continue;
688689
}
689-
const entry = this.entries[num];
690690
const ref = Ref.get(parseInt(num), entry.gen);
691691
let obj;
692692

@@ -695,7 +695,6 @@ class XRef {
695695
} catch {
696696
continue;
697697
}
698-
699698
if (obj instanceof BaseStream) {
700699
obj = obj.dict;
701700
}

0 commit comments

Comments
 (0)