mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
[api-minor] Fix completely broken getStats
method by returning stats in Objects, rather than in Arrays (PR 11029 follow-up)
With the changes to the `StreamType`/`FontType` "enums" in PR 11029, one unfortunate result is that `getStats` now *always* returns empty Arrays. Something that everyone, myself included, apparently missed is that you obviously cannot index an Array with Strings :-) I wrongly assumed that the unit-tests would catch any bugs, but they apparently suffered from the same issue as the code in `src/core/`. Another possible option could perhaps be to use `Set`s, rather than objects, but that will require larger changes since `LoopbackPort` (in `src/display/api.js`) doesn't support them.
This commit is contained in:
parent
9c8fe3142a
commit
0276385e6e
3 changed files with 8 additions and 8 deletions
|
@ -205,10 +205,10 @@ function setPDFNetworkStreamFactory(pdfNetworkStreamFactory) {
|
|||
|
||||
/**
|
||||
* @typedef {Object} PDFDocumentStats
|
||||
* @property {Array} streamTypes - Used stream types in the document (an item
|
||||
* @property {Object} streamTypes - Used stream types in the document (an item
|
||||
* is set to true if specific stream ID was used in the document).
|
||||
* @property {Array} fontTypes - Used font type in the document (an item is set
|
||||
* to true if specific font ID was used in the document).
|
||||
* @property {Object} fontTypes - Used font types in the document (an item
|
||||
* is set to true if specific font ID was used in the document).
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue