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:
parent
a2a200175f
commit
70d362f22c
@ -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;
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user