1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 17:48:07 +02:00

Change the createPromiseCapability helper function into a PromiseCapability class

This is not only slightly more compact, but it also simplifies the handling of the `settled` getter.
This commit is contained in:
Jonas Jenwald 2022-03-07 17:41:41 +01:00
parent f9c2a8d437
commit 317abd6d07
24 changed files with 117 additions and 122 deletions

View file

@ -16,12 +16,12 @@
import {
AbortException,
assert,
createPromiseCapability,
getVerbosityLevel,
info,
InvalidPDFException,
MissingPDFException,
PasswordException,
PromiseCapability,
setVerbosityLevel,
stringToPDFString,
UnexpectedResponseException,
@ -46,7 +46,7 @@ class WorkerTask {
constructor(name) {
this.name = name;
this.terminated = false;
this._capability = createPromiseCapability();
this._capability = new PromiseCapability();
}
get finished() {
@ -228,7 +228,7 @@ class WorkerMessageHandler {
password,
rangeChunkSize,
};
const pdfManagerCapability = createPromiseCapability();
const pdfManagerCapability = new PromiseCapability();
let newPdfManager;
if (data) {