Shorten the PDFDocument.prototype.fieldObjects getter slightly#19903
Merged
calixteman merged 1 commit intomozilla:masterfrom May 9, 2025
Merged
Shorten the PDFDocument.prototype.fieldObjects getter slightly#19903calixteman merged 1 commit intomozilla:masterfrom
PDFDocument.prototype.fieldObjects getter slightly#19903calixteman merged 1 commit intomozilla:masterfrom
Conversation
The effect is probably not even measurable, however this patch ever so slightly reduces the asynchronicity in the `fieldObjects` getter. These changes should be safe since: - We're inside of the `PDFDocument`-class and the `annotationGlobals`-getter, which will always return a (shadowed) Promise and won't throw `MissingDataException`s, can be accessed directly without going through the `BasePdfManager`-instance. - The `acroForm`-dictionary can be accessed through the `annotationGlobals`-data, removing the need to "manually" look it up and thus the need for using `Promise.all` here. - We can also lookup the /Fields-data, in the `acroForm`-dictionary, synchronously since the initial `formInfo.hasFields` check guarantees that it's available.
Collaborator
Author
|
/botio test |
Collaborator
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.193.163.58:8877/57737e487ed05a3/output.txt |
Collaborator
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.241.84.105:8877/998bbb19f36abec/output.txt |
Collaborator
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/998bbb19f36abec/output.txt Total script time: 30.00 mins
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The effect is probably not even measurable, however this patch ever so slightly reduces the asynchronicity in the
fieldObjectsgetter. These changes should be safe since:We're inside of the
PDFDocument-class and theannotationGlobals-getter, which will always return a (shadowed) Promise and won't throwMissingDataExceptions, can be accessed directly without going through theBasePdfManager-instance.The
acroForm-dictionary can be accessed through theannotationGlobals-data, removing the need to "manually" look it up and thus the need for usingPromise.allhere.We can also lookup the /Fields-data, in the
acroForm-dictionary, synchronously since the initialformInfo.hasFieldscheck guarantees that it's available.