mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +02:00
Merge pull request #17854 from Snuffleupagus/rm-PromiseCapability
[api-minor] Replace the `PromiseCapability` with `Promise.withResolvers()`
This commit is contained in:
commit
2e5282928f
28 changed files with 159 additions and 252 deletions
|
@ -46,7 +46,6 @@ import {
|
|||
isPdfFile,
|
||||
MissingPDFException,
|
||||
PDFWorker,
|
||||
PromiseCapability,
|
||||
shadow,
|
||||
UnexpectedResponseException,
|
||||
version,
|
||||
|
@ -92,7 +91,10 @@ const ViewOnLoad = {
|
|||
|
||||
const PDFViewerApplication = {
|
||||
initialBookmark: document.location.hash.substring(1),
|
||||
_initializedCapability: new PromiseCapability(),
|
||||
_initializedCapability: {
|
||||
...Promise.withResolvers(),
|
||||
settled: false,
|
||||
},
|
||||
appConfig: null,
|
||||
pdfDocument: null,
|
||||
pdfLoadingTask: null,
|
||||
|
@ -240,6 +242,7 @@ const PDFViewerApplication = {
|
|||
this.bindEvents();
|
||||
this.bindWindowEvents();
|
||||
|
||||
this._initializedCapability.settled = true;
|
||||
this._initializedCapability.resolve();
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue