mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
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). |
||
---|---|---|
.. | ||
chromium | ||
features | ||
font | ||
integration | ||
pdfs | ||
resources | ||
stats | ||
ttx | ||
types | ||
unit | ||
.eslintrc | ||
.gitignore | ||
add_test.js | ||
annotation_layer_builder_overrides.css | ||
downloadutils.js | ||
driver.js | ||
integration-boot.js | ||
test.js | ||
test_manifest.json | ||
test_slave.html | ||
testutils.js | ||
text_layer_test.css | ||
webserver.js |