Skip to content

[pull] master from mozilla:master - #480

Merged
pull[bot] merged 2 commits into
code:masterfrom
mozilla:master
Jul 31, 2026
Merged

[pull] master from mozilla:master#480
pull[bot] merged 2 commits into
code:masterfrom
mozilla:master

Conversation

@pull

@pull pull Bot commented Jul 31, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

Compared to regular Objects there's a number of advantages to using Maps:
 - They support proper iteration.
 - They have a simple way to check for the existence of data.
 - They have a simple/efficient way to check the number of elements.

If this functionality was added today, I cannot imagine that we'd choose an Object for this data.

Note also how in the scripting-implementation the `actions` were already converted into a Map, via the `createActionsMap` helper.
In the Firefox PDF Viewer sending `Map`s to the scripting-implementation should be fine, since it uses the browser `Cu.cloneInto` functionality; see https://searchfox.org/firefox-main/source/toolkit/components/pdfjs/content/PdfSandbox.sys.mjs
However with QuickJS, used by the GENERIC viewer, all data needs to be stringified and unfortunately `JSON.stringify()` doesn't support Maps. Hence we convert Maps to Objects, via a [`replacer` function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#replacer), since the existing `createActionsMap` usage will convert the actions-Objects back to Maps.
[api-minor] Convert `getJSActions` to return data in a Map
@pull pull Bot locked and limited conversation to collaborators Jul 31, 2026
@pull pull Bot added the ⤵️ pull label Jul 31, 2026
@pull
pull Bot merged commit ce4ff55 into code:master Jul 31, 2026
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
@pull
pull Bot had a problem deploying to code-coverage July 31, 2026 14:03 Failure
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant