From 0a9176422ee818e33259170fedde78fc96e38954 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 15 Feb 2026 16:34:05 +0100 Subject: [PATCH] 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 --- src/core/xref.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/xref.js b/src/core/xref.js index c13c08a7d..6ff5a1e52 100644 --- a/src/core/xref.js +++ b/src/core/xref.js @@ -683,10 +683,10 @@ class XRef { // iterate over empty entries so we use the `in` operator instead of // using for..of on entries() or a for with the array length. for (const num in this.entries) { - if (!Object.hasOwn(this.entries, num)) { + const entry = this.entries[num]; + if (!entry) { continue; } - const entry = this.entries[num]; const ref = Ref.get(parseInt(num), entry.gen); let obj; @@ -695,7 +695,6 @@ class XRef { } catch { continue; } - if (obj instanceof BaseStream) { obj = obj.dict; }