'use strict' everywhere
This commit is contained in:
		
							parent
							
								
									0aae9ef880
								
							
						
					
					
						commit
						e71b6188c6
					
				
							
								
								
									
										2
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								Makefile
									
									
									
									
									
								
							| @ -45,7 +45,7 @@ test: pdfjs shell-test browser-test | |||||||
| # Create production output (pdf.js, and corresponding changes to web files)
 | # Create production output (pdf.js, and corresponding changes to web files)
 | ||||||
| #
 | #
 | ||||||
| production: | bundle | production: | bundle | ||||||
| 	@echo "Preparing production viewer..."; \
 | 	@echo "Preparing viewer-production.html..."; \
 | ||||||
| 	cd web; \
 | 	cd web; \
 | ||||||
| 	sed '/PDFJSSCRIPT_REMOVE/d' viewer.html > viewer-1.tmp; \
 | 	sed '/PDFJSSCRIPT_REMOVE/d' viewer.html > viewer-1.tmp; \
 | ||||||
| 	sed '/PDFJSSCRIPT_INCLUDE_BUILD/ r viewer-snippet.html' viewer-1.tmp > viewer-production.html; \
 | 	sed '/PDFJSSCRIPT_INCLUDE_BUILD/ r viewer-snippet.html' viewer-1.tmp > viewer-production.html; \
 | ||||||
|  | |||||||
| @ -1,5 +1,8 @@ | |||||||
| // <canvas> contexts store most of the state we need natively.
 | // <canvas> contexts store most of the state we need natively.
 | ||||||
| // However, PDF needs a bit more state, which we store here.
 | // However, PDF needs a bit more state, which we store here.
 | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var CanvasExtraState = (function canvasExtraState() { | var CanvasExtraState = (function canvasExtraState() { | ||||||
|   function constructor(old) { |   function constructor(old) { | ||||||
|     // Are soft masks and alpha values shapes or opacities?
 |     // Are soft masks and alpha values shapes or opacities?
 | ||||||
|  | |||||||
| @ -1,6 +1,8 @@ | |||||||
| /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
| /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
| 
 | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var ISOAdobeCharset = [ | var ISOAdobeCharset = [ | ||||||
|   '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', |   '.notdef', 'space', 'exclam', 'quotedbl', 'numbersign', 'dollar', | ||||||
|   'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', |   'percent', 'ampersand', 'quoteright', 'parenleft', 'parenright', | ||||||
|  | |||||||
| @ -1,6 +1,8 @@ | |||||||
| /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
| /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
| 
 | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var CIDToUnicodeMaps = { | var CIDToUnicodeMaps = { | ||||||
|   'Adobe-Japan1': [[32, 160], {f: 12, c: 33}, [45, 8209], {f: 46, c: 46}, 165, |   'Adobe-Japan1': [[32, 160], {f: 12, c: 33}, [45, 8209], {f: 46, c: 46}, 165, | ||||||
|     {f: 2, c: 93}, [95, 818], [96, 768], {f: 27, c: 97}, 166, 125, [732, 771], |     {f: 2, c: 93}, [95, 818], [96, 768], {f: 27, c: 97}, 166, 125, [732, 771], | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var ColorSpace = (function colorSpaceColorSpace() { | var ColorSpace = (function colorSpaceColorSpace() { | ||||||
|   // Constructor should define this.numComps, this.defaultColor, this.name
 |   // Constructor should define this.numComps, this.defaultColor, this.name
 | ||||||
|   function constructor() { |   function constructor() { | ||||||
|  | |||||||
							
								
								
									
										13
									
								
								src/core.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								src/core.js
									
									
									
									
									
								
							| @ -1,16 +1,19 @@ | |||||||
| /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
| /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
| 
 | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
|  | var globalScope = (typeof window === 'undefined') ? this : window; | ||||||
|  | 
 | ||||||
| var ERRORS = 0, WARNINGS = 1, TODOS = 5; | var ERRORS = 0, WARNINGS = 1, TODOS = 5; | ||||||
| var verbosity = WARNINGS; | var verbosity = WARNINGS; | ||||||
| 
 |  | ||||||
| var useWorker = false; | var useWorker = false; | ||||||
| 
 | 
 | ||||||
| // The global PDF object exposes the API
 | // The global PDF object exposes the API
 | ||||||
| // In production, it will be declared outside a global wrapper
 | // In production, it will be declared outside a global wrapper
 | ||||||
| // In development, it will be declared here
 | // In development, it will be declared here
 | ||||||
| if (typeof PDF === 'undefined') { | if (!globalScope.PDF) { | ||||||
|   PDF = {}; |   globalScope.PDF = {}; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| // getPdf()
 | // getPdf()
 | ||||||
| @ -46,7 +49,7 @@ function getPdf(arg, callback) { | |||||||
|   }; |   }; | ||||||
|   xhr.send(null); |   xhr.send(null); | ||||||
| } | } | ||||||
| PDF.getPdf = getPdf; | globalScope.PDF.getPdf = getPdf; | ||||||
| 
 | 
 | ||||||
| var Page = (function pagePage() { | var Page = (function pagePage() { | ||||||
|   function constructor(xref, pageNumber, pageDict, ref) { |   function constructor(xref, pageNumber, pageDict, ref) { | ||||||
| @ -605,4 +608,4 @@ var PDFDoc = (function() { | |||||||
| 
 | 
 | ||||||
|   return constructor; |   return constructor; | ||||||
| })(); | })(); | ||||||
| PDF.PDFDoc = PDFDoc; | globalScope.PDF.PDFDoc = PDFDoc; | ||||||
|  | |||||||
| @ -1,6 +1,8 @@ | |||||||
| /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
| /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
| 
 | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var ARCFourCipher = (function arcFourCipher() { | var ARCFourCipher = (function arcFourCipher() { | ||||||
|   function constructor(key) { |   function constructor(key) { | ||||||
|     this.a = 0; |     this.a = 0; | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var PartialEvaluator = (function partialEvaluator() { | var PartialEvaluator = (function partialEvaluator() { | ||||||
|   function constructor(xref, handler, uniquePrefix) { |   function constructor(xref, handler, uniquePrefix) { | ||||||
|     this.state = new EvalState(); |     this.state = new EvalState(); | ||||||
|  | |||||||
| @ -1,6 +1,8 @@ | |||||||
| /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
| /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
| 
 | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var isWorker = (typeof window == 'undefined'); | var isWorker = (typeof window == 'undefined'); | ||||||
| 
 | 
 | ||||||
| /** | /** | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var PDFFunction = (function() { | var PDFFunction = (function() { | ||||||
|   var CONSTRUCT_SAMPLED = 0; |   var CONSTRUCT_SAMPLED = 0; | ||||||
|   var CONSTRUCT_INTERPOLATED = 2; |   var CONSTRUCT_INTERPOLATED = 2; | ||||||
|  | |||||||
| @ -1,6 +1,8 @@ | |||||||
| /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
| /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
| 
 | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var GlyphsUnicode = { | var GlyphsUnicode = { | ||||||
|   A: 0x0041, |   A: 0x0041, | ||||||
|   AE: 0x00C6, |   AE: 0x00C6, | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var PDFImage = (function pdfImage() { | var PDFImage = (function pdfImage() { | ||||||
|   function constructor(xref, res, image, inline) { |   function constructor(xref, res, image, inline) { | ||||||
|     this.image = image; |     this.image = image; | ||||||
|  | |||||||
| @ -1,6 +1,8 @@ | |||||||
| /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
| /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
| 
 | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var Metrics = { | var Metrics = { | ||||||
|   'Courier': 600, |   'Courier': 600, | ||||||
|   'Courier-Bold': 600, |   'Courier-Bold': 600, | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var Name = (function nameName() { | var Name = (function nameName() { | ||||||
|   function constructor(name) { |   function constructor(name) { | ||||||
|     this.name = name; |     this.name = name; | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var EOF = {}; | var EOF = {}; | ||||||
| 
 | 
 | ||||||
| function isEOF(v) { | function isEOF(v) { | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var Pattern = (function patternPattern() { | var Pattern = (function patternPattern() { | ||||||
|   // Constructor should define this.getPattern
 |   // Constructor should define this.getPattern
 | ||||||
|   function constructor() { |   function constructor() { | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| var Stream = (function streamStream() { | var Stream = (function streamStream() { | ||||||
|   function constructor(arrayBuffer, start, length, dict) { |   function constructor(arrayBuffer, start, length, dict) { | ||||||
|     this.bytes = new Uint8Array(arrayBuffer); |     this.bytes = new Uint8Array(arrayBuffer); | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| function log(msg) { | function log(msg) { | ||||||
|   if (console && console.log) |   if (console && console.log) | ||||||
|     console.log(msg); |     console.log(msg); | ||||||
|  | |||||||
| @ -1,6 +1,8 @@ | |||||||
| /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- / | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
| /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
| 
 | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| function MessageHandler(name, comObj) { | function MessageHandler(name, comObj) { | ||||||
|   this.name = name; |   this.name = name; | ||||||
|   this.comObj = comObj; |   this.comObj = comObj; | ||||||
| @ -172,9 +174,9 @@ var workerConsole = { | |||||||
| 
 | 
 | ||||||
| // Worker thread?
 | // Worker thread?
 | ||||||
| if (typeof window === 'undefined') { | if (typeof window === 'undefined') { | ||||||
|   console = workerConsole; |   globalScope.console = workerConsole; | ||||||
| 
 | 
 | ||||||
|   // Listen for messages from the main thread.
 |   // Listen for messages from the main thread.
 | ||||||
|   var handler = new MessageHandler('worker_processor', this); |   var handler = new MessageHandler('worker_processor', globalScope); | ||||||
|   WorkerProcessorHandler.setup(handler); |   WorkerProcessorHandler.setup(handler); | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,3 +1,8 @@ | |||||||
|  | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ | ||||||
|  | /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ | ||||||
|  | 
 | ||||||
|  | 'use strict'; | ||||||
|  | 
 | ||||||
| importScripts('../src/core.js'); | importScripts('../src/core.js'); | ||||||
| importScripts('../src/util.js'); | importScripts('../src/util.js'); | ||||||
| importScripts('../src/canvas.js'); | importScripts('../src/canvas.js'); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user