Removes rest of 'no-else-return' comments.
This commit is contained in:
		
							parent
							
								
									6265bb6038
								
							
						
					
					
						commit
						77b7b84d1e
					
				| @ -360,25 +360,25 @@ var FontFaceObject = (function FontFaceObjectClosure() { | ||||
|   } | ||||
|   FontFaceObject.prototype = { | ||||
|     createNativeFontFace: function FontFaceObject_createNativeFontFace() { | ||||
|       if (typeof PDFJSDev === 'undefined' || !PDFJSDev.test('MOZCENTRAL')) { | ||||
|         if (!this.data) { | ||||
|           return null; | ||||
|         } | ||||
| 
 | ||||
|         if (this.options.disableFontFace) { | ||||
|           this.disableFontFace = true; | ||||
|           return null; | ||||
|         } | ||||
| 
 | ||||
|         var nativeFontFace = new FontFace(this.loadedName, this.data, {}); | ||||
| 
 | ||||
|         if (this.options.fontRegistry) { | ||||
|           this.options.fontRegistry.registerFont(this); | ||||
|         } | ||||
|         return nativeFontFace; | ||||
|       } else { // eslint-disable-line no-else-return
 | ||||
|       if (typeof PDFJSDev !== 'undefined' && PDFJSDev.test('MOZCENTRAL')) { | ||||
|         throw new Error('Not implemented: createNativeFontFace'); | ||||
|       } | ||||
| 
 | ||||
|       if (!this.data) { | ||||
|         return null; | ||||
|       } | ||||
| 
 | ||||
|       if (this.options.disableFontFace) { | ||||
|         this.disableFontFace = true; | ||||
|         return null; | ||||
|       } | ||||
| 
 | ||||
|       var nativeFontFace = new FontFace(this.loadedName, this.data, {}); | ||||
| 
 | ||||
|       if (this.options.fontRegistry) { | ||||
|         this.options.fontRegistry.registerFont(this); | ||||
|       } | ||||
|       return nativeFontFace; | ||||
|     }, | ||||
| 
 | ||||
|     createFontFaceRule: function FontFaceObject_createFontFaceRule() { | ||||
|  | ||||
| @ -624,43 +624,43 @@ var PDFPageView = (function PDFPageViewClosure() { | ||||
|           onRenderContinue: function (cont) { }, | ||||
|           cancel: function () { }, | ||||
|         }; | ||||
|       } else { // eslint-disable-line no-else-return
 | ||||
|         var cancelled = false; | ||||
|         var ensureNotCancelled = function () { | ||||
|           if (cancelled) { | ||||
|             throw 'cancelled'; | ||||
|           } | ||||
|         }; | ||||
| 
 | ||||
|         var self = this; | ||||
|         var pdfPage = this.pdfPage; | ||||
|         var SVGGraphics = pdfjsLib.SVGGraphics; | ||||
|         var actualSizeViewport = this.viewport.clone({scale: CSS_UNITS}); | ||||
|         var promise = pdfPage.getOperatorList().then(function (opList) { | ||||
|           ensureNotCancelled(); | ||||
|           var svgGfx = new SVGGraphics(pdfPage.commonObjs, pdfPage.objs); | ||||
|           return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) { | ||||
|             ensureNotCancelled(); | ||||
|             self.svg = svg; | ||||
|             self.paintedViewport = actualSizeViewport; | ||||
| 
 | ||||
|             svg.style.width = wrapper.style.width; | ||||
|             svg.style.height = wrapper.style.height; | ||||
|             self.renderingState = RenderingStates.FINISHED; | ||||
|             wrapper.appendChild(svg); | ||||
|           }); | ||||
|         }); | ||||
| 
 | ||||
|         return { | ||||
|           promise: promise, | ||||
|           onRenderContinue: function (cont) { | ||||
|             cont(); | ||||
|           }, | ||||
|           cancel: function () { | ||||
|             cancelled = true; | ||||
|           } | ||||
|         }; | ||||
|       } | ||||
| 
 | ||||
|       var cancelled = false; | ||||
|       var ensureNotCancelled = function () { | ||||
|         if (cancelled) { | ||||
|           throw 'cancelled'; | ||||
|         } | ||||
|       }; | ||||
| 
 | ||||
|       var self = this; | ||||
|       var pdfPage = this.pdfPage; | ||||
|       var SVGGraphics = pdfjsLib.SVGGraphics; | ||||
|       var actualSizeViewport = this.viewport.clone({scale: CSS_UNITS}); | ||||
|       var promise = pdfPage.getOperatorList().then(function (opList) { | ||||
|         ensureNotCancelled(); | ||||
|         var svgGfx = new SVGGraphics(pdfPage.commonObjs, pdfPage.objs); | ||||
|         return svgGfx.getSVG(opList, actualSizeViewport).then(function (svg) { | ||||
|           ensureNotCancelled(); | ||||
|           self.svg = svg; | ||||
|           self.paintedViewport = actualSizeViewport; | ||||
| 
 | ||||
|           svg.style.width = wrapper.style.width; | ||||
|           svg.style.height = wrapper.style.height; | ||||
|           self.renderingState = RenderingStates.FINISHED; | ||||
|           wrapper.appendChild(svg); | ||||
|         }); | ||||
|       }); | ||||
| 
 | ||||
|       return { | ||||
|         promise: promise, | ||||
|         onRenderContinue: function (cont) { | ||||
|           cont(); | ||||
|         }, | ||||
|         cancel: function () { | ||||
|           cancelled = true; | ||||
|         } | ||||
|       }; | ||||
|     }, | ||||
| 
 | ||||
|     /** | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user