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 = [];
|
cachedChunks = [];
|
||||||
};
|
};
|
||||||
const readPromise = new Promise(function (resolve, reject) {
|
new Promise(function (resolve, reject) {
|
||||||
const readChunk = function ({ value, done }) {
|
const readChunk = function ({ value, done }) {
|
||||||
try {
|
try {
|
||||||
ensureNotTerminated();
|
ensureNotTerminated();
|
||||||
@ -335,8 +335,7 @@ class WorkerMessageHandler {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
fullRequest.read().then(readChunk, reject);
|
fullRequest.read().then(readChunk, reject);
|
||||||
});
|
}).catch(function (e) {
|
||||||
readPromise.catch(function (e) {
|
|
||||||
pdfManagerCapability.reject(e);
|
pdfManagerCapability.reject(e);
|
||||||
cancelXHRs = null;
|
cancelXHRs = null;
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user