Introduce even more optional chaining in the code-base
This replaces a few more small/simple if-statements with optional chaining.
This commit is contained in:
		
							parent
							
								
									f89020e9b1
								
							
						
					
					
						commit
						ec7746350d
					
				| @ -546,9 +546,8 @@ class ChunkedStreamManager { | |||||||
| 
 | 
 | ||||||
|   abort(reason) { |   abort(reason) { | ||||||
|     this.aborted = true; |     this.aborted = true; | ||||||
|     if (this.pdfNetworkStream) { |     this.pdfNetworkStream?.cancelAllRequests(reason); | ||||||
|       this.pdfNetworkStream.cancelAllRequests(reason); | 
 | ||||||
|     } |  | ||||||
|     for (const capability of this._promisesByRequest.values()) { |     for (const capability of this._promisesByRequest.values()) { | ||||||
|       capability.reject(reason); |       capability.reject(reason); | ||||||
|     } |     } | ||||||
|  | |||||||
| @ -2533,11 +2533,9 @@ class WorkerTransport { | |||||||
|       this.#methodPromises.clear(); |       this.#methodPromises.clear(); | ||||||
|       this.filterFactory.destroy(); |       this.filterFactory.destroy(); | ||||||
| 
 | 
 | ||||||
|       if (this._networkStream) { |       this._networkStream?.cancelAllRequests( | ||||||
|         this._networkStream.cancelAllRequests( |  | ||||||
|         new AbortException("Worker was terminated.") |         new AbortException("Worker was terminated.") | ||||||
|       ); |       ); | ||||||
|       } |  | ||||||
| 
 | 
 | ||||||
|       if (this.messageHandler) { |       if (this.messageHandler) { | ||||||
|         this.messageHandler.destroy(); |         this.messageHandler.destroy(); | ||||||
|  | |||||||
| @ -878,10 +878,8 @@ class AnnotationEditorUIManager { | |||||||
|   copy(event) { |   copy(event) { | ||||||
|     event.preventDefault(); |     event.preventDefault(); | ||||||
| 
 | 
 | ||||||
|     if (this.#activeEditor) { |  | ||||||
|     // An editor is being edited so just commit it.
 |     // An editor is being edited so just commit it.
 | ||||||
|       this.#activeEditor.commitOrRemove(); |     this.#activeEditor?.commitOrRemove(); | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     if (!this.hasSelection) { |     if (!this.hasSelection) { | ||||||
|       return; |       return; | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user