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:
parent
f9c2a8d437
commit
317abd6d07
24 changed files with 117 additions and 122 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue