mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-22 16:18:08 +02:00
Add (some) optional chaining usage in src/display/api.js
Since we no longer use SystemJS to load the unit-tests, there's now nothing that prevents us from using optional chaining and nullish coalescing in the `src/display/` directory.
This commit is contained in:
parent
1c4495843c
commit
c293fc2b8f
1 changed files with 2 additions and 4 deletions
|
@ -1168,8 +1168,7 @@ class PDFPageProxy {
|
|||
pageIndex: this._pageIndex,
|
||||
intent: renderingIntent,
|
||||
renderInteractiveForms: renderInteractiveForms === true,
|
||||
annotationStorage:
|
||||
(annotationStorage && annotationStorage.getAll()) || null,
|
||||
annotationStorage: annotationStorage?.getAll() || null,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -2551,8 +2550,7 @@ class WorkerTransport {
|
|||
return this.messageHandler
|
||||
.sendWithPromise("SaveDocument", {
|
||||
numPages: this._numPages,
|
||||
annotationStorage:
|
||||
(annotationStorage && annotationStorage.getAll()) || null,
|
||||
annotationStorage: annotationStorage?.getAll() || null,
|
||||
filename: this._fullReader ? this._fullReader.filename : null,
|
||||
})
|
||||
.finally(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue