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
@ -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…
Reference in New Issue
Block a user