mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-05-31 07:11:00 +02:00
Note that `Ref`s and `Name`s are cached globally[1], since that helps reduce object creation (a lot) during parsing. That cache will be cleared after a period of inactivity in the viewer[2], which is why those primitives cannot *safely* be compared with just `===`/`!==` and also (partially) why abstractions such as `RefSet`/`RefSetCache` are necessary. Currently `deepCompare` doesn't handle `Ref`s and `Name`s correctly, which may lead to future *intermittent* bugs in any code using the `deepCompare` helper function. --- [1] This applies to `Cmd` as well, however that doesn't matter in the context of this patch. [2] Currently, and for more than a decade, set to 30 seconds.