Remove an unnecessary variable in getPdfManager, in the src/core/worker.js file

Another tiny piece of clean-up, since adding a `catch`-handler to a Promise shouldn't require an intermediate variable.
This commit is contained in:
Jonas Jenwald 2022-11-17 15:19:40 +01:00
parent a2a200175f
commit 70d362f22c

View File

@ -303,7 +303,7 @@ class WorkerMessageHandler {
}
cachedChunks = [];
};
const readPromise = new Promise(function (resolve, reject) {
new Promise(function (resolve, reject) {
const readChunk = function ({ value, done }) {
try {
ensureNotTerminated();
@ -335,8 +335,7 @@ class WorkerMessageHandler {
}
};
fullRequest.read().then(readChunk, reject);
});
readPromise.catch(function (e) {
}).catch(function (e) {
pdfManagerCapability.reject(e);
cancelXHRs = null;
});