37998076c9
In the case where the document was destroyed, we were rejecting the `Promise` in `JpegDecode` with a string instead of an `Error`. The patch also brings the wording more inline with other such rejections. Use the `isInt` utility function when validating the `pageNumber` parameter in `WorkerTransport_getPage`, to make it more obvious what's actually happening. There's also a couple more unit-tests added, to ensure that we always fail in the expected way. Finally, we can simplify the rejection handling in `WorkerTransport_getPageIndexByRef` somewhat. (Note that the only reason for using `catch` here is that since the promise is rejected on the worker side, the `reason` becomes a string instead of an `Error` which is why we "re-reject" on the display side.) |
||
---|---|---|
.. | ||
annotation_layer_spec.js | ||
api_spec.js | ||
cff_parser_spec.js | ||
cmap_spec.js | ||
crypto_spec.js | ||
dom_utils_spec.js | ||
evaluator_spec.js | ||
fonts_spec.js | ||
function_spec.js | ||
jasmine-boot.js | ||
metadata_spec.js | ||
network_spec.js | ||
parser_spec.js | ||
primitives_spec.js | ||
stream_spec.js | ||
testreporter.js | ||
type1_parser_spec.js | ||
ui_utils_spec.js | ||
unicode_spec.js | ||
unit_test.html | ||
util_spec.js |