1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-29 07:37:57 +02:00
pdf.js/src/core
Jonas Jenwald e9038cc3d1 Send the AnnotationStorage-data to the worker-thread as a Map
Rather than converting the `AnnotationStorage`-data to an Object, before sending it to the worker-thread, we should be able to simply send the internal `Map` directly.
The "structured clone algorithm" doesn't have a problem with `Map`s, however the `LoopbackPort` used when workers are *disabled* (e.g. in Node.js environments) didn't use to support them. With PR 12997 having lifted that restriction, we should now be able to simply send the `AnnotationStorage`-data as-is rather than having to iterate through it to first create an Object.

*Please note:* The changes in `src/core/annotation.js` could have been a lot more compact if we were able to use optional chaining in the `src/core` folder. Unfortunately that's still not possible, since SystemJS is being used in the development viewer (i.g. `gulp server`) and fixing that is *still* blocked by [bug 1247687](https://bugzilla.mozilla.org/show_bug.cgi?id=1247687).
2021-02-18 17:13:43 +01:00
..
xfa XFA - Add support for prototypes (#12979) 2021-02-18 10:32:25 +01:00
.eslintrc Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
annotation.js Send the AnnotationStorage-data to the worker-thread as a Map 2021-02-18 17:13:43 +01:00
arithmetic_decoder.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
bidi.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
ccitt.js Enable the dot-notation ESLint rule 2020-04-17 12:24:46 +02:00
ccitt_stream.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
cff_parser.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
charsets.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
chunked_stream.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
cmap.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
colorspace.js Use Math.hypot, instead of Math.sqrt with manual squaring (#12973) 2021-02-10 12:28:49 +01:00
core_utils.js Move the encodeToXmlString helper function to src/core/core_utils.js 2021-02-17 13:12:01 +01:00
crypto.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
default_appearance.js Ensure that parseDefaultAppearance won't attempt to access a not yet defined variable (PR 12831 follow-up) 2021-01-23 15:33:28 +01:00
document.js JS -- Add tests for print/save actions 2020-12-24 18:51:00 +01:00
encodings.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
evaluator.js Remove unneeded instanceof MissingDataException checks 2021-02-13 12:26:05 +01:00
font_renderer.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
fonts.js Always re-measure non-embedded ArialNarrow fonts (bug 1671312, PR 12725 follow-up) 2021-01-14 15:51:48 +01:00
function.js Simplify the PDFFunctionFactory._localFunctionCache initialization (PR 12034 follow-up) 2021-01-22 12:25:05 +01:00
glyphlist.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
image.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
image_utils.js Ignore globally cached images in PartialEvaluator.getTextContent (PR 11930 follow-up) 2021-01-28 10:19:26 +01:00
jbig2.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
jbig2_stream.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
jpeg_stream.js [api-minor] Decode all JPEG images with the built-in PDF.js decoder in src/core/jpg.js 2020-05-22 00:22:48 +02:00
jpg.js Improve handling of JPEG images without an EOI marker (issue 12841) 2021-01-09 20:19:39 +01:00
jpx.js Ignore, rather than throwing on, unsupported Coding style default (COD) options in JPEG 2000 images (issue 11004) 2020-12-21 20:35:52 +01:00
jpx_stream.js Update Prettier to version 2.0 2020-04-14 12:28:14 +02:00
metadata_parser.js Move the XML-parser to the src/core/-folder 2021-02-17 13:12:01 +01:00
metrics.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
murmurhash3.js Ensure that MurmurHash3_64.update handles ArrayBuffer input correctly, to avoid hash-collisions (issue 12533) 2020-10-26 16:27:33 +01:00
obj.js Move the Metadata parsing to the worker-thread 2021-02-17 13:12:01 +01:00
operator_list.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
parser.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
pattern.js Use Math.hypot, instead of Math.sqrt with manual squaring (#12973) 2021-02-10 12:28:49 +01:00
pdf_manager.js Allow GlobalImageCache.clear to, optionally, only remove the actual data (PR 11912 follow-up) 2020-05-23 11:30:24 +02:00
primitives.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
ps_parser.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
standard_fonts.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
stream.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
type1_parser.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
unicode.js Use ESLint to ensure that exports are sorted alphabetically 2021-01-09 20:37:51 +01:00
worker.js [api-minor] Rename -es5 to -legacy, to reduce confusion over what's actually supported (issue 12976) 2021-02-10 16:01:59 +01:00
worker_stream.js Re-factor how the ESLint no-var rule is enabled in the src/ folder 2020-10-03 20:15:29 +02:00
writer.js Move the XML-parser to the src/core/-folder 2021-02-17 13:12:01 +01:00
xml_parser.js Move the encodeToXmlString helper function to src/core/core_utils.js 2021-02-17 13:12:01 +01:00