pdf.js/test
Jonas Jenwald 2fcf8bb5be Re-factor searching for incomplete objects in XRef.indexObjects (issue 15803)
When trying to find incomplete objects, i.e. those missing the "endobj"-string at the end, there's unfortunately a number of possible operators that we need to check for. Otherwise we could miss e.g. the "trailer" at the end of a corrupt PDF document, which is why the referenced document didn't work.

Currently we do all searching on the "raw" bytes of the PDF document, for efficiency, however this doesn't really work when we need to check for *multiple* potential command-strings. To keep the complexity manageable we'll instead use regular expressions here, but we can at least avoid creating lots of substrings thanks to the `RegExp.lastIndex` property; which is well supported across browsers according to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp/lastIndex#browser_compatibility

Note that this repeated regular expression usage could perhaps be slightly less efficient than the old code, however this method is only invoked for corrupt PDF documents.
2022-12-19 23:01:09 +01:00
..
chromium Enable the ESLint no-var rule globally 2021-03-13 16:12:53 +01:00
font Enable the ESLint prefer-spread rule 2022-08-06 10:17:00 +02:00
integration [JS] Run the named actions before running the format when the file is open (issue #15818) 2022-12-13 21:12:32 +01:00
pdfs Re-factor searching for incomplete objects in XRef.indexObjects (issue 15803) 2022-12-19 23:01:09 +01:00
resources Enable the unicorn/prefer-regexp-test ESLint plugin rule 2022-09-19 16:34:01 +02:00
stats Use more for...of loops in the code-base 2022-07-17 16:18:54 +02:00
ttx Update ttx from version 2.5 to version 3.19.0 2022-07-10 21:18:36 +02:00
types Add support for modern ECMAScript class features 2021-10-22 22:01:17 +02:00
unit [api-minor] Allow specifying an extra-delay, in RenderTask.cancel, for worker-thread aborting of operatorList parsing 2022-12-14 12:34:16 +01:00
.eslintrc Enable ESLint rules that no longer need to be disabled on a directory/file-basis 2021-01-22 17:47:03 +01:00
.gitignore Ignore test snapshots directory. 2013-03-15 11:24:08 -07:00
add_test.js Enable the ESLint no-var rule in test/add_test.js 2021-03-14 10:25:51 +01:00
annotation_layer_builder_overrides.css [Annotation] Add a div containing the text of a FreeText annotation (bug 1780375) 2022-08-04 11:14:05 +02:00
downloadutils.js Make verifyManifestFiles fail for non-linked test-cases with a "link": true-entry 2021-09-10 09:51:34 +02:00
driver.js Merge pull request #15775 from Snuffleupagus/vars-all 2022-12-07 10:30:47 +01:00
integration-boot.js [Annotations] Add some aria-owns in the text layer to link to annotations (bug 1780375) 2022-08-12 14:35:26 +02:00
test_manifest.json Re-factor searching for incomplete objects in XRef.indexObjects (issue 15803) 2022-12-19 23:01:09 +01:00
test_slave.html Tighten the vars-argument for the ESLint no-unused-vars rule 2022-12-04 16:15:50 +01:00
test.js Update npm packages 2022-10-16 09:38:58 +02:00
testutils.js Enable the no-var linting rule in test/testutils.js 2021-12-18 15:58:47 +01:00
text_layer_test.css Refactor the text layer code in order to avoid to recompute it on each draw 2022-12-01 18:42:43 +01:00
webserver.js Remove the LGTM configuration and inline disable comments (issue 13829) 2021-08-03 11:14:49 +02:00
xfa_layer_builder_overrides.css XFA - Fix xfaLink class to make links work (bug 1735738) 2021-10-29 11:39:33 -04:00