1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 07:08:08 +02:00
pdf.js/src
Jonas Jenwald 642d8621ef Replace direct lookup of uniquePrefix/idCounters, in Page instances, with an idFactory containing an createObjId method instead
We're currently making use of `uniquePrefix`/`idCounters` in multiple files, to create unique object id's, and adding a new occurrence of them requires some care to ensure that an object id isn't accidentally reused.
Furthermore, having to pass around multiple parameters as we currently do seem like something you want to avoid.

Instead, this patch adds a factory which means that there's only *one* thing that needs to be passed around. And since it's now only necessary to call a method in order to obtain a unique object id, the details are thus abstracted away at the call-sites which avoids accidental reuse of object id's.

To test that this works as expected a very simple `Page` unit-test is added, and the existing `Annotation layer` tests are also adjusted slightly.
2017-01-09 23:16:25 +01:00
..
core Replace direct lookup of uniquePrefix/idCounters, in Page instances, with an idFactory containing an createObjId method instead 2017-01-09 23:16:25 +01:00
display Enable the no-else-return ESLint rule 2017-01-09 20:27:39 +01:00
images Vectorize the logo. 2012-10-29 14:08:52 -04:00
shared Remove globals that are now unnecessary thanks to the use of various ESLint environments (e.g. Node, ShellJS, Jasmine) 2016-12-16 21:09:55 +01:00
doc_helper.js Switch to using ESLint, instead of JSHint, for linting 2016-12-16 21:06:36 +01:00
main_loader.js Deprecate the isValidUrl utility function and replace it with createValidAbsoluteUrl/isValidProtocal functions instead, since the main URL validation is now done using the new URL constructor 2016-10-19 22:11:22 +02:00
pdf.js Switch to using ESLint, instead of JSHint, for linting 2016-12-16 21:06:36 +01:00
pdf.worker.entry.js Switch to using ESLint, instead of JSHint, for linting 2016-12-16 21:06:36 +01:00
worker_loader.js Replaces all preprocessor directives with PDFJSDev calls. 2016-10-14 10:57:53 -05:00