3351d3476d
*This patch is based on a couple of smaller things that I noticed when working on PR 12479.* - Don't store the /Fields on the `formInfo` getter, since that feels like overloading it with unintended (and too complex) data, and utilize a `hasFields` boolean instead. This functionality was originally added in PR 12271, to help determine what kind of form data a PDF document contains, and I think that we should ensure that the return value of `formInfo` only consists of "simple" data. With these changes the `fieldObjects` getter instead has to look-up the /Fields manually, however that shouldn't be a problem since the access is guarded by a `formInfo.hasFields` check which ensures that the data both exists and is valid. Furthermore, most documents doesn't even have any /AcroForm data anyway. - Determine the `hasFields` property *first*, to ensure that it's always correct even if there's errors when checking e.g. the /XFA or /SigFlags entires, since the `fieldObjects` getter depends on it. - Simplify a loop in `fieldObjects`, since the object being accessed is a `Map` and those have built-in iteration support. - Use a higher logging level for errors in the `formInfo` getter, and include the actual error message, since that'd have helped with fixing PR 12479 a lot quicker. - Update the JSDoc comment in `src/display/api.js` to list the return values correctly, and also slightly extend/improve the description. |
||
---|---|---|
.. | ||
annotation_spec.js | ||
annotation_storage_spec.js | ||
api_spec.js | ||
bidi_spec.js | ||
cff_parser_spec.js | ||
clitests_helper.js | ||
clitests.json | ||
cmap_spec.js | ||
colorspace_spec.js | ||
core_utils_spec.js | ||
crypto_spec.js | ||
custom_spec.js | ||
display_svg_spec.js | ||
display_utils_spec.js | ||
document_spec.js | ||
encodings_spec.js | ||
evaluator_spec.js | ||
fetch_stream_spec.js | ||
function_spec.js | ||
jasmine-boot.js | ||
message_handler_spec.js | ||
metadata_spec.js | ||
murmurhash3_spec.js | ||
network_spec.js | ||
network_utils_spec.js | ||
node_stream_spec.js | ||
parser_spec.js | ||
pdf_find_controller_spec.js | ||
pdf_find_utils_spec.js | ||
pdf_history_spec.js | ||
primitives_spec.js | ||
stream_spec.js | ||
test_utils.js | ||
testreporter.js | ||
type1_parser_spec.js | ||
ui_utils_spec.js | ||
unicode_spec.js | ||
unit_test.html | ||
util_spec.js | ||
writer_spec.js | ||
xml_spec.js |