-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Remove unneeded instanceof MissingDataException
checks
#12988
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove unneeded instanceof MissingDataException
checks
#12988
Conversation
The following checks are all unneeded, and could easily cause confusion when reading the code. (All of them are my fault as well, since I've sometimes added those checks without really thinking about the surrounding code.) - In `PartialEvaluator.hasBlendModes` there cannot be any `MissingDataException`s thrown, given that the `Page.getOperatorList` method waits for all the necessary /Resources to load first. Furthermore, note also that if an error is thrown from `PartialEvaluator.hasBlendModes` then it'd completely break rendering of that page, since any errors thrown from `Page.getOperatorList` are simply sent to the main-thread. - In `PartialEvaluator.handleColorN` there cannot be any `MissingDataException`s thrown, given that again the `Page.getOperatorList` method waits for all the necessary /Resources to load before operatorList parsing starts. - In `XRef.readXRef` there cannot be any `MissingDataException`s thrown, given that we're *explicitly* requesting (and waiting for) the entire document in `pdfManagerReady` (in `src/core/worker.js`) before re-parsing of a corrupt document starts.
/botio test |
From: Bot.io (Linux m4)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://54.67.70.0:8877/df78e371438f3ee/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_test from @Snuffleupagus received. Current queue size: 0 Live output at: http://3.101.106.178:8877/dc6590d3dd951f4/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.67.70.0:8877/df78e371438f3ee/output.txt Total script time: 23.62 mins
Image differences available at: http://54.67.70.0:8877/df78e371438f3ee/reftest-analyzer.html#web=eq.log |
From: Bot.io (Windows)FailedFull output at http://3.101.106.178:8877/dc6590d3dd951f4/output.txt Total script time: 30.11 mins
Image differences available at: http://3.101.106.178:8877/dc6590d3dd951f4/reftest-analyzer.html#web=eq.log |
Thanks! /botio makeref (since this was forgotten in another PR) |
From: Bot.io (Linux m4)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 0 Live output at: http://54.67.70.0:8877/de3b81c4190ee56/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_makeref from @timvandermeij received. Current queue size: 1 Live output at: http://3.101.106.178:8877/0562c0f33dd1cb3/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.67.70.0:8877/de3b81c4190ee56/output.txt Total script time: 21.91 mins
|
From: Bot.io (Windows)SuccessFull output at http://3.101.106.178:8877/0562c0f33dd1cb3/output.txt Total script time: 27.18 mins
|
The following checks are all unneeded, and could easily cause confusion when reading the code. (All of them are my fault as well, since I've sometimes added those checks without really thinking about the surrounding code.)
In
PartialEvaluator.hasBlendModes
there cannot be anyMissingDataException
s thrown, given that thePage.getOperatorList
method waits for all the necessary /Resources to load first. Furthermore, note also that if an error is thrown fromPartialEvaluator.hasBlendModes
then it'd completely break rendering of that page, since any errors thrown fromPage.getOperatorList
are simply sent to the main-thread.In
PartialEvaluator.handleColorN
there cannot be anyMissingDataException
s thrown, given that again thePage.getOperatorList
method waits for all the necessary /Resources to load before operatorList parsing starts.In
XRef.readXRef
there cannot be anyMissingDataException
s thrown, given that we're explicitly requesting (and waiting for) the entire document inpdfManagerReady
(insrc/core/worker.js
) before re-parsing of a corrupt document starts.