瀏覽代碼

PDF.js version 1.8.207 - See mozilla/pdf.js@fd51a7cb8c704c034e80c131c6f70b3e77705499

pdfjsbot 8 年之前
父節點
當前提交
88f1022800
共有 64 個文件被更改,包括 1259 次插入1189 次删除
  1. 1 1
      bower.json
  2. 370 358
      build/pdf.combined.js
  3. 72 64
      build/pdf.js
  4. 0 0
      build/pdf.min.js
  5. 362 350
      build/pdf.worker.js
  6. 0 0
      build/pdf.worker.min.js
  7. 1 1
      lib/core/chunked_stream.js
  8. 28 28
      lib/core/cmap.js
  9. 2 2
      lib/core/document.js
  10. 16 16
      lib/core/evaluator.js
  11. 6 6
      lib/core/font_renderer.js
  12. 11 11
      lib/core/fonts.js
  13. 10 8
      lib/core/function.js
  14. 1 1
      lib/core/jbig2.js
  15. 3 1
      lib/core/jpg.js
  16. 3 1
      lib/core/murmurhash3.js
  17. 3 1
      lib/core/obj.js
  18. 3 1
      lib/core/primitives.js
  19. 1 1
      lib/core/type1_parser.js
  20. 10 8
      lib/core/worker.js
  21. 17 15
      lib/display/api.js
  22. 3 3
      lib/display/canvas.js
  23. 1 1
      lib/display/dom_utils.js
  24. 4 4
      lib/display/font_loader.js
  25. 6 6
      lib/display/global.js
  26. 1 1
      lib/display/text_layer.js
  27. 2 2
      lib/pdf.js
  28. 2 2
      lib/pdf.worker.js
  29. 28 26
      lib/shared/compatibility.js
  30. 7 5
      lib/shared/util.js
  31. 3 3
      lib/test/unit/annotation_spec.js
  32. 6 4
      lib/test/unit/api_spec.js
  33. 1 1
      lib/test/unit/cff_parser_spec.js
  34. 1 1
      lib/test/unit/cmap_spec.js
  35. 4 4
      lib/test/unit/evaluator_spec.js
  36. 2 2
      lib/test/unit/function_spec.js
  37. 9 9
      lib/test/unit/jasmine-boot.js
  38. 3 3
      lib/test/unit/network_spec.js
  39. 6 6
      lib/test/unit/primitives_spec.js
  40. 2 2
      lib/test/unit/stream_spec.js
  41. 1 1
      lib/test/unit/test_utils.js
  42. 1 1
      lib/test/unit/testreporter.js
  43. 3 3
      lib/test/unit/ui_utils_spec.js
  44. 1 1
      lib/web/annotation_layer_builder.js
  45. 8 8
      lib/web/app.js
  46. 37 37
      lib/web/chromecom.js
  47. 8 6
      lib/web/debugger.js
  48. 3 3
      lib/web/firefox_print_service.js
  49. 13 11
      lib/web/firefoxcom.js
  50. 14 14
      lib/web/interfaces.js
  51. 1 1
      lib/web/pdf_find_bar.js
  52. 3 3
      lib/web/pdf_find_controller.js
  53. 13 11
      lib/web/pdf_link_service.js
  54. 8 8
      lib/web/pdf_page_view.js
  55. 8 8
      lib/web/pdf_print_service.js
  56. 2 2
      lib/web/pdf_sidebar.js
  57. 1 1
      lib/web/pdf_thumbnail_viewer.js
  58. 17 17
      lib/web/pdf_viewer.js
  59. 5 2
      lib/web/preferences.js
  60. 1 1
      lib/web/text_layer_builder.js
  61. 4 4
      lib/web/toolbar.js
  62. 1 1
      package.json
  63. 31 27
      web/compatibility.js
  64. 64 59
      web/pdf_viewer.js

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.8.205",
+  "version": "1.8.207",
   "main": [
     "build/pdf.js",
     "build/pdf.worker.js"

文件差異過大導致無法顯示
+ 370 - 358
build/pdf.combined.js


+ 72 - 64
build/pdf.js

@@ -98,6 +98,8 @@ return /******/ (function(modules) { // webpackBootstrap
 "use strict";
 /* WEBPACK VAR INJECTION */(function(global) {
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var compatibility = __w_pdfjs_require__(14);
 var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : undefined;
 var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
@@ -510,7 +512,7 @@ function removeNullCharacters(str) {
   return str.replace(NullCharactersRegExp, '');
 }
 function bytesToString(bytes) {
-  assert(bytes !== null && typeof bytes === 'object' && bytes.length !== undefined, 'Invalid argument for bytesToString');
+  assert(bytes !== null && (typeof bytes === 'undefined' ? 'undefined' : _typeof(bytes)) === 'object' && bytes.length !== undefined, 'Invalid argument for bytesToString');
   var length = bytes.length;
   var MAX_ARGUMENT_COUNT = 8192;
   if (length < MAX_ARGUMENT_COUNT) {
@@ -881,14 +883,14 @@ function isArray(v) {
   return v instanceof Array;
 }
 function isArrayBuffer(v) {
-  return typeof v === 'object' && v !== null && v.byteLength !== undefined;
+  return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v !== null && v.byteLength !== undefined;
 }
 function isSpace(ch) {
   return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A;
 }
 function isNodeJS() {
   if (typeof __pdfjsdev_webpack__ === 'undefined') {
-    return typeof process === 'object' && process + '' === '[object process]';
+    return (typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process + '' === '[object process]';
   }
   return false;
 }
@@ -1081,14 +1083,14 @@ MessageHandler.prototype = {
     }
     return capability.promise;
   },
-  postMessage: function (message, transfers) {
+  postMessage: function postMessage(message, transfers) {
     if (transfers && this.postMessageTransfers) {
       this.comObj.postMessage(message, transfers);
     } else {
       this.comObj.postMessage(message);
     }
   },
-  destroy: function () {
+  destroy: function destroy() {
     this.comObj.removeEventListener('message', this._onComObjOnMessage);
   }
 };
@@ -1221,7 +1223,7 @@ var DOMCMapReaderFactory = function DOMCMapReaderFactoryClosure() {
     this.isCompressed = params.isCompressed || false;
   }
   DOMCMapReaderFactory.prototype = {
-    fetch: function (params) {
+    fetch: function fetch(params) {
       var name = params.name;
       if (!name) {
         return Promise.reject(new Error('CMap name must be specified.'));
@@ -2083,6 +2085,8 @@ exports.AnnotationLayer = AnnotationLayer;
 "use strict";
 
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var sharedUtil = __w_pdfjs_require__(0);
 var displayFontLoader = __w_pdfjs_require__(11);
 var displayCanvas = __w_pdfjs_require__(10);
@@ -2178,7 +2182,7 @@ function getDocument(src, pdfDataRangeTransport, passwordCallback, progressCallb
   } else if (src instanceof PDFDataRangeTransport) {
     source = { range: src };
   } else {
-    if (typeof src !== 'object') {
+    if ((typeof src === 'undefined' ? 'undefined' : _typeof(src)) !== 'object') {
       error('Invalid parameter in getDocument, need either Uint8Array, ' + 'string or a parameter object');
     }
     if (!src.url && !src.data && !src.range) {
@@ -2203,7 +2207,7 @@ function getDocument(src, pdfDataRangeTransport, passwordCallback, progressCallb
       var pdfBytes = source[key];
       if (typeof pdfBytes === 'string') {
         params[key] = stringToBytes(pdfBytes);
-      } else if (typeof pdfBytes === 'object' && pdfBytes !== null && !isNaN(pdfBytes.length)) {
+      } else if ((typeof pdfBytes === 'undefined' ? 'undefined' : _typeof(pdfBytes)) === 'object' && pdfBytes !== null && !isNaN(pdfBytes.length)) {
         params[key] = new Uint8Array(pdfBytes);
       } else if (isArrayBuffer(pdfBytes)) {
         params[key] = new Uint8Array(pdfBytes);
@@ -2285,7 +2289,7 @@ var PDFDocumentLoadingTask = function PDFDocumentLoadingTaskClosure() {
     get promise() {
       return this._capability.promise;
     },
-    destroy: function () {
+    destroy: function destroy() {
       this.destroyed = true;
       var transportDestroyed = !this._transport ? Promise.resolve() : this._transport.destroy();
       return transportDestroyed.then(function () {
@@ -2585,7 +2589,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
       this.pendingCleanup = false;
       return Promise.all(waitOn);
     },
-    destroy: function () {
+    destroy: function destroy() {
       deprecated('page destroy method, use cleanup() instead');
       this.cleanup();
     },
@@ -2667,9 +2671,9 @@ var PDFWorker = function PDFWorkerClosure() {
     this._deferred = Promise.resolve(undefined);
   }
   FakeWorkerPort.prototype = {
-    postMessage: function (obj, transfers) {
+    postMessage: function postMessage(obj, transfers) {
       function cloneValue(value) {
-        if (typeof value !== 'object' || value === null) {
+        if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) {
           return value;
         }
         if (cloned.has(value)) {
@@ -2718,14 +2722,14 @@ var PDFWorker = function PDFWorkerClosure() {
         }, this);
       }.bind(this));
     },
-    addEventListener: function (name, listener) {
+    addEventListener: function addEventListener(name, listener) {
       this._listeners.push(listener);
     },
-    removeEventListener: function (name, listener) {
+    removeEventListener: function removeEventListener(name, listener) {
       var i = this._listeners.indexOf(listener);
       this._listeners.splice(i, 1);
     },
-    terminate: function () {
+    terminate: function terminate() {
       this._listeners = [];
     }
   };
@@ -2827,7 +2831,7 @@ var PDFWorker = function PDFWorkerClosure() {
               this._setupFakeWorker();
             }
           }.bind(this));
-          var sendTest = function () {
+          var sendTest = function sendTest() {
             var postMessageTransfers = getDefaultSetting('postMessageTransfers') && !isPostMessageTransfersDisabled;
             var testObj = new Uint8Array([postMessageTransfers ? 255 : 0]);
             try {
@@ -3036,7 +3040,7 @@ var WorkerTransport = function WorkerTransportClosure() {
             var fontRegistry = null;
             if (getDefaultSetting('pdfBug') && globalScope.FontInspector && globalScope['FontInspector'].enabled) {
               fontRegistry = {
-                registerFont: function (font, url) {
+                registerFont: function registerFont(font, url) {
                   globalScope['FontInspector'].fontAdded(font, url);
                 }
               };
@@ -3437,19 +3441,19 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
 var _UnsupportedManager = function UnsupportedManagerClosure() {
   var listeners = [];
   return {
-    listen: function (cb) {
+    listen: function listen(cb) {
       deprecated('Global UnsupportedManager.listen is used: ' + ' use PDFDocumentLoadingTask.onUnsupportedFeature instead');
       listeners.push(cb);
     },
-    notify: function (featureId) {
+    notify: function notify(featureId) {
       for (var i = 0, ii = listeners.length; i < ii; i++) {
         listeners[i](featureId);
       }
     }
   };
 }();
-exports.version = '1.8.205';
-exports.build = 'bc1f4dd9';
+exports.version = '1.8.207';
+exports.build = 'fd51a7cb';
 exports.getDocument = getDocument;
 exports.PDFDataRangeTransport = PDFDataRangeTransport;
 exports.PDFWorker = PDFWorker;
@@ -4621,7 +4625,7 @@ var renderTextLayer = function renderTextLayerClosure() {
         ts[i + 56] = s && (e.right - t[0]) / s;
         ts[i + 60] = c && (e.bottom - t[1]) / -c;
       });
-      var findPositiveMin = function (ts, offset, count) {
+      var findPositiveMin = function findPositiveMin(ts, offset, count) {
         var result = 0;
         for (var i = 0; i < count; i++) {
           var t = ts[offset++];
@@ -4912,6 +4916,8 @@ exports.renderTextLayer = renderTextLayer;
 "use strict";
 
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var g;
 g = function () {
   return this;
@@ -4919,7 +4925,7 @@ g = function () {
 try {
   g = g || Function("return this")() || (1, eval)("this");
 } catch (e) {
-  if (typeof window === "object") g = window;
+  if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
 }
 module.exports = g;
 
@@ -5388,18 +5394,18 @@ if (!globalScope.PDFJS) {
   globalScope.PDFJS = {};
 }
 var PDFJS = globalScope.PDFJS;
-PDFJS.version = '1.8.205';
-PDFJS.build = 'bc1f4dd9';
+PDFJS.version = '1.8.207';
+PDFJS.build = 'fd51a7cb';
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {
   sharedUtil.setVerbosityLevel(PDFJS.verbosity);
 }
 delete PDFJS.verbosity;
 Object.defineProperty(PDFJS, 'verbosity', {
-  get: function () {
+  get: function get() {
     return sharedUtil.getVerbosityLevel();
   },
-  set: function (level) {
+  set: function set(level) {
     sharedUtil.setVerbosityLevel(level);
   },
   enumerable: true,
@@ -5453,10 +5459,10 @@ PDFJS.pdfjsNext = PDFJS.pdfjsNext === undefined ? false : PDFJS.pdfjsNext;
 var savedOpenExternalLinksInNewWindow = PDFJS.openExternalLinksInNewWindow;
 delete PDFJS.openExternalLinksInNewWindow;
 Object.defineProperty(PDFJS, 'openExternalLinksInNewWindow', {
-  get: function () {
+  get: function get() {
     return PDFJS.externalLinkTarget === LinkTarget.BLANK;
   },
-  set: function (value) {
+  set: function set(value) {
     if (value) {
       deprecated('PDFJS.openExternalLinksInNewWindow, please use ' + '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.');
     }
@@ -5626,7 +5632,7 @@ var CachedCanvases = function CachedCanvasesClosure() {
       }
       return canvasEntry;
     },
-    clear: function () {
+    clear: function clear() {
       for (var id in this.cache) {
         var canvasEntry = this.cache[id];
         this.canvasFactory.destroy(canvasEntry);
@@ -5755,7 +5761,7 @@ function compileType3Glyph(imgData) {
     outlines.push(coords);
     --i;
   }
-  var drawOutline = function (c) {
+  var drawOutline = function drawOutline(c) {
     c.save();
     c.scale(1 / width, -1 / height);
     c.translate(0, -height);
@@ -6770,7 +6776,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
         var baseTransform = this.baseTransform || this.ctx.mozCurrentTransform.slice();
         var self = this;
         var canvasGraphicsFactory = {
-          createCanvasGraphics: function (ctx) {
+          createCanvasGraphics: function createCanvasGraphics(ctx) {
             return new CanvasGraphics(ctx, self.commonObjs, self.objs, self.canvasFactory);
           }
         };
@@ -7256,11 +7262,11 @@ FontLoader.prototype = {
     this.nativeFontFaces.length = 0;
   }
 };
-var getLoadTestFont = function () {
+var getLoadTestFont = function getLoadTestFont() {
   return atob('T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQ' + 'AABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwA' + 'AAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbm' + 'FtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAA' + 'AADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6A' + 'ABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAA' + 'MQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAA' + 'AAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAA' + 'AAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQ' + 'AAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMA' + 'AQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAA' + 'EAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAA' + 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAA' + 'AAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgc' + 'A/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWF' + 'hYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQA' + 'AAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAg' + 'ABAAAAAAAAAAAD6AAAAAAAAA==');
 };
 Object.defineProperty(FontLoader.prototype, 'loadTestFont', {
-  get: function () {
+  get: function get() {
     return shadow(this, 'loadTestFont', getLoadTestFont());
   },
   configurable: true
@@ -7273,7 +7279,7 @@ FontLoader.prototype.bind = function fontLoaderBind(fonts, callback) {
   var rules = [];
   var fontsToLoad = [];
   var fontLoadPromises = [];
-  var getNativeFontPromise = function (nativeFontFace) {
+  var getNativeFontPromise = function getNativeFontPromise(nativeFontFace) {
     return nativeFontFace.loaded.catch(function (e) {
       warn('Failed to load font "' + nativeFontFace.family + '": ' + e);
     });
@@ -7411,7 +7417,7 @@ var isSyncFontLoadingSupported = function isSyncFontLoadingSupported() {
   return supported;
 };
 Object.defineProperty(FontLoader, 'isSyncFontLoadingSupported', {
-  get: function () {
+  get: function get() {
     return shadow(FontLoader, 'isSyncFontLoadingSupported', isSyncFontLoadingSupported());
   },
   enumerable: true,
@@ -7877,8 +7883,8 @@ exports.TilingPattern = TilingPattern;
 "use strict";
 
 
-var pdfjsVersion = '1.8.205';
-var pdfjsBuild = 'bc1f4dd9';
+var pdfjsVersion = '1.8.207';
+var pdfjsBuild = 'fd51a7cb';
 var pdfjsSharedUtil = __w_pdfjs_require__(0);
 var pdfjsDisplayGlobal = __w_pdfjs_require__(9);
 var pdfjsDisplayAPI = __w_pdfjs_require__(3);
@@ -7920,6 +7926,8 @@ exports.addLinkAttributes = pdfjsDisplayDOMUtils.addLinkAttributes;
 "use strict";
 /* WEBPACK VAR INJECTION */(function(global) {
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
   var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : undefined;
   var userAgent = typeof navigator !== 'undefined' && navigator.userAgent || '';
@@ -7933,7 +7941,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
   var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent);
   var isOpera = userAgent.indexOf('Opera') >= 0;
   var isSafari = /Safari\//.test(userAgent) && !/(Chrome\/|Android\s)/.test(userAgent);
-  var hasDOM = typeof window === 'object' && typeof document === 'object';
+  var hasDOM = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object';
   if (typeof PDFJS === 'undefined') {
     globalScope.PDFJS = {};
   }
@@ -7974,12 +7982,12 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
     var uint32ArrayViewSetters = 0;
     function createUint32ArrayProp(index) {
       return {
-        get: function () {
+        get: function get() {
           var buffer = this.buffer,
               offset = index << 2;
           return (buffer[offset] | buffer[offset + 1] << 8 | buffer[offset + 2] << 16 | buffer[offset + 3] << 24) >>> 0;
         },
-        set: function (value) {
+        set: function set(value) {
           var buffer = this.buffer,
               offset = index << 2;
           buffer[offset] = value & 255;
@@ -8014,7 +8022,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       result.buffer = result;
       result.byteLength = result.length;
       result.set = setArrayOffset;
-      if (typeof arg1 === 'object' && arg1.buffer) {
+      if ((typeof arg1 === 'undefined' ? 'undefined' : _typeof(arg1)) === 'object' && arg1.buffer) {
         result.buffer = arg1.buffer;
       }
       return result;
@@ -8044,14 +8052,14 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     Object.defineProperty(cpaProto, 'buffer', {
-      get: function () {
+      get: function get() {
         return this;
       },
       enumerable: false,
       configurable: true
     });
     Object.defineProperty(cpaProto, 'byteLength', {
-      get: function () {
+      get: function get() {
         return this.length;
       },
       enumerable: false,
@@ -8220,7 +8228,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     Object.defineProperty(HTMLElement.prototype, 'dataset', {
-      get: function () {
+      get: function get() {
         if (this._dataset) {
           return this._dataset;
         }
@@ -8270,21 +8278,21 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     var classListPrototype = {
-      add: function (name) {
+      add: function add(name) {
         changeList(this.element, name, true, false);
       },
-      contains: function (name) {
+      contains: function contains(name) {
         return changeList(this.element, name, false, false);
       },
-      remove: function (name) {
+      remove: function remove(name) {
         changeList(this.element, name, false, true);
       },
-      toggle: function (name) {
+      toggle: function toggle(name) {
         changeList(this.element, name, true, true);
       }
     };
     Object.defineProperty(HTMLElement.prototype, 'classList', {
-      get: function () {
+      get: function get() {
         if (this._classList) {
           return this._classList;
         }
@@ -8346,9 +8354,9 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
     }
     if (!('console' in window)) {
       window.console = {
-        log: function () {},
-        error: function () {},
-        warn: function () {}
+        log: function log() {},
+        error: function error() {},
+        warn: function warn() {}
       };
       return;
     }
@@ -8498,7 +8506,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     Object.defineProperty(document, 'currentScript', {
-      get: function () {
+      get: function get() {
         var scripts = document.getElementsByTagName('script');
         return scripts[scripts.length - 1];
       },
@@ -8517,10 +8525,10 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       var inputProto = el.constructor.prototype;
       var typeProperty = Object.getOwnPropertyDescriptor(inputProto, 'type');
       Object.defineProperty(inputProto, 'type', {
-        get: function () {
+        get: function get() {
           return typeProperty.get.call(this);
         },
-        set: function (value) {
+        set: function set(value) {
           typeProperty.set.call(this, value === 'number' ? 'text' : value);
         },
         enumerable: true,
@@ -8538,11 +8546,11 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
     var documentProto = document.constructor.prototype;
     var readyStateProto = Object.getOwnPropertyDescriptor(documentProto, 'readyState');
     Object.defineProperty(documentProto, 'readyState', {
-      get: function () {
+      get: function get() {
         var value = readyStateProto.get.call(this);
         return value === 'interactive' ? 'loading' : value;
       },
-      set: function (value) {
+      set: function set(value) {
         readyStateProto.set.call(this, value);
       },
       enumerable: true,
@@ -8831,20 +8839,20 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       this.id = '$weakmap' + id++;
     }
     WeakMap.prototype = {
-      has: function (obj) {
+      has: function has(obj) {
         return !!Object.getOwnPropertyDescriptor(obj, this.id);
       },
-      get: function (obj, defaultValue) {
+      get: function get(obj, defaultValue) {
         return this.has(obj) ? obj[this.id] : defaultValue;
       },
-      set: function (obj, value) {
+      set: function set(obj, value) {
         Object.defineProperty(obj, this.id, {
           value: value,
           enumerable: false,
           configurable: true
         });
       },
-      delete: function (obj) {
+      delete: function _delete(obj) {
         delete obj[this.id];
       }
     };
@@ -8853,7 +8861,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
   (function checkURLConstructor() {
     var hasWorkingUrl = false;
     try {
-      if (typeof URL === 'function' && typeof URL.prototype === 'object' && 'origin' in URL.prototype) {
+      if (typeof URL === 'function' && _typeof(URL.prototype) === 'object' && 'origin' in URL.prototype) {
         var u = new URL('b', 'http://a');
         u.pathname = 'c%20d';
         hasWorkingUrl = u.href === 'http://a/c%20d';
@@ -9275,7 +9283,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       parse.call(this, input, null, base);
     }
     JURL.prototype = {
-      toString: function () {
+      toString: function toString() {
         return this.href;
       },
       get href() {

文件差異過大導致無法顯示
+ 0 - 0
build/pdf.min.js


文件差異過大導致無法顯示
+ 362 - 350
build/pdf.worker.js


文件差異過大導致無法顯示
+ 0 - 0
build/pdf.worker.min.js


+ 1 - 1
lib/core/chunked_stream.js

@@ -252,7 +252,7 @@ var ChunkedStreamManager = function ChunkedStreamManagerClosure() {
           loaded = 0;
       var manager = this;
       var promise = new Promise(function (resolve, reject) {
-        var readChunk = function (chunk) {
+        var readChunk = function readChunk(chunk) {
           try {
             if (!chunk.done) {
               var data = chunk.value;

+ 28 - 28
lib/core/cmap.js

@@ -44,23 +44,23 @@ var CMap = function CMapClosure() {
     this.builtInCMap = builtInCMap;
   }
   CMap.prototype = {
-    addCodespaceRange: function (n, low, high) {
+    addCodespaceRange: function addCodespaceRange(n, low, high) {
       this.codespaceRanges[n - 1].push(low, high);
       this.numCodespaceRanges++;
     },
-    mapCidRange: function (low, high, dstLow) {
+    mapCidRange: function mapCidRange(low, high, dstLow) {
       while (low <= high) {
         this._map[low++] = dstLow++;
       }
     },
-    mapBfRange: function (low, high, dstLow) {
+    mapBfRange: function mapBfRange(low, high, dstLow) {
       var lastByte = dstLow.length - 1;
       while (low <= high) {
         this._map[low++] = dstLow;
         dstLow = dstLow.substr(0, lastByte) + String.fromCharCode(dstLow.charCodeAt(lastByte) + 1);
       }
     },
-    mapBfRangeToArray: function (low, high, array) {
+    mapBfRangeToArray: function mapBfRangeToArray(low, high, array) {
       var i = 0,
           ii = array.length;
       while (low <= high && i < ii) {
@@ -68,16 +68,16 @@ var CMap = function CMapClosure() {
         ++low;
       }
     },
-    mapOne: function (src, dst) {
+    mapOne: function mapOne(src, dst) {
       this._map[src] = dst;
     },
-    lookup: function (code) {
+    lookup: function lookup(code) {
       return this._map[code];
     },
-    contains: function (code) {
+    contains: function contains(code) {
       return this._map[code] !== undefined;
     },
-    forEach: function (callback) {
+    forEach: function forEach(callback) {
       var map = this._map;
       var length = map.length;
       var i;
@@ -93,13 +93,13 @@ var CMap = function CMapClosure() {
         }
       }
     },
-    charCodeOf: function (value) {
+    charCodeOf: function charCodeOf(value) {
       return this._map.indexOf(value);
     },
-    getMap: function () {
+    getMap: function getMap() {
       return this._map;
     },
-    readCharCode: function (str, offset, out) {
+    readCharCode: function readCharCode(str, offset, out) {
       var c = 0;
       var codespaceRanges = this.codespaceRanges;
       var codespaceRangesLen = this.codespaceRanges.length;
@@ -148,33 +148,33 @@ var IdentityCMap = function IdentityCMapClosure() {
   Util.inherit(IdentityCMap, CMap, {});
   IdentityCMap.prototype = {
     addCodespaceRange: CMap.prototype.addCodespaceRange,
-    mapCidRange: function (low, high, dstLow) {
+    mapCidRange: function mapCidRange(low, high, dstLow) {
       error('should not call mapCidRange');
     },
-    mapBfRange: function (low, high, dstLow) {
+    mapBfRange: function mapBfRange(low, high, dstLow) {
       error('should not call mapBfRange');
     },
-    mapBfRangeToArray: function (low, high, array) {
+    mapBfRangeToArray: function mapBfRangeToArray(low, high, array) {
       error('should not call mapBfRangeToArray');
     },
-    mapOne: function (src, dst) {
+    mapOne: function mapOne(src, dst) {
       error('should not call mapCidOne');
     },
-    lookup: function (code) {
+    lookup: function lookup(code) {
       return isInt(code) && code <= 0xffff ? code : undefined;
     },
-    contains: function (code) {
+    contains: function contains(code) {
       return isInt(code) && code <= 0xffff;
     },
-    forEach: function (callback) {
+    forEach: function forEach(callback) {
       for (var i = 0; i <= 0xffff; i++) {
         callback(i, i);
       }
     },
-    charCodeOf: function (value) {
+    charCodeOf: function charCodeOf(value) {
       return isInt(value) && value <= 0xffff ? value : -1;
     },
-    getMap: function () {
+    getMap: function getMap() {
       var map = new Array(0x10000);
       for (var i = 0; i <= 0xffff; i++) {
         map[i] = i;
@@ -233,13 +233,13 @@ var BinaryCMapReader = function BinaryCMapReaderClosure() {
     this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE);
   }
   BinaryCMapStream.prototype = {
-    readByte: function () {
+    readByte: function readByte() {
       if (this.pos >= this.end) {
         return -1;
       }
       return this.buffer[this.pos++];
     },
-    readNumber: function () {
+    readNumber: function readNumber() {
       var n = 0;
       var last;
       do {
@@ -252,15 +252,15 @@ var BinaryCMapReader = function BinaryCMapReaderClosure() {
       } while (!last);
       return n;
     },
-    readSigned: function () {
+    readSigned: function readSigned() {
       var n = this.readNumber();
       return n & 1 ? ~(n >>> 1) : n >>> 1;
     },
-    readHex: function (num, size) {
+    readHex: function readHex(num, size) {
       num.set(this.buffer.subarray(this.pos, this.pos + size + 1));
       this.pos += size + 1;
     },
-    readHexNumber: function (num, size) {
+    readHexNumber: function readHexNumber(num, size) {
       var last;
       var stack = this.tmpBuf,
           sp = 0;
@@ -286,7 +286,7 @@ var BinaryCMapReader = function BinaryCMapReaderClosure() {
         bufferSize -= 8;
       }
     },
-    readHexSigned: function (num, size) {
+    readHexSigned: function readHexSigned(num, size) {
       this.readHexNumber(num, size);
       var sign = num[size] & 1 ? 255 : 0;
       var c = 0;
@@ -295,7 +295,7 @@ var BinaryCMapReader = function BinaryCMapReaderClosure() {
         num[i] = c >> 1 ^ sign;
       }
     },
-    readString: function () {
+    readString: function readString() {
       var len = this.readNumber();
       var s = '';
       for (var i = 0; i < len; i++) {
@@ -689,7 +689,7 @@ var CMapFactory = function CMapFactoryClosure() {
     });
   }
   return {
-    create: function (params) {
+    create: function create(params) {
       var encoding = params.encoding;
       var fetchBuiltInCMap = params.fetchBuiltInCMap;
       var useCMap = params.useCMap;

+ 2 - 2
lib/core/document.js

@@ -71,7 +71,7 @@ var Page = function PageClosure() {
     var uniquePrefix = 'p' + this.pageIndex + '_';
     var idCounters = { obj: 0 };
     this.idFactory = {
-      createObjId: function () {
+      createObjId: function createObjId() {
         return uniquePrefix + ++idCounters.obj;
       }
     };
@@ -432,7 +432,7 @@ var PDFDocument = function PDFDocumentClosure() {
       this.xref.parse(recoveryMode);
       var self = this;
       var pageFactory = {
-        createPage: function (pageIndex, dict, ref, fontCache, builtInCMapCache) {
+        createPage: function createPage(pageIndex, dict, ref, fontCache, builtInCMapCache) {
           return new Page(self.pdfManager, self.xref, pageIndex, dict, ref, fontCache, builtInCMapCache);
         }
       };

+ 16 - 16
lib/core/evaluator.js

@@ -106,10 +106,10 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
     this.forceDataSchema = forceDataSchema;
   }
   NativeImageDecoder.prototype = {
-    canDecode: function (image) {
+    canDecode: function canDecode(image) {
       return image instanceof JpegStream && NativeImageDecoder.isDecodable(image, this.xref, this.resources);
     },
-    decode: function (image) {
+    decode: function decode(image) {
       var dict = image.dict;
       var colorSpace = dict.get('ColorSpace', 'CS');
       colorSpace = ColorSpace.parse(colorSpace, this.xref, this.resources);
@@ -223,7 +223,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
   var TILING_PATTERN = 1,
       SHADING_PATTERN = 2;
   PartialEvaluator.prototype = {
-    clone: function (newOptions) {
+    clone: function clone(newOptions) {
       newOptions = newOptions || DefaultPartialEvaluatorOptions;
       var newEvaluator = Object.create(this);
       newEvaluator.options = newOptions;
@@ -694,7 +694,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
         }
       }
       return new Promise(function promiseBody(resolve, reject) {
-        var next = function (promise) {
+        var next = function next(promise) {
           promise.then(function () {
             try {
               promiseBody(resolve, reject);
@@ -1136,7 +1136,7 @@ var PartialEvaluator = function PartialEvaluatorClosure() {
       }
       var timeSlotManager = new TimeSlotManager();
       return new Promise(function promiseBody(resolve, reject) {
-        var next = function (promise) {
+        var next = function next(promise) {
           promise.then(function () {
             try {
               promiseBody(resolve, reject);
@@ -1920,7 +1920,7 @@ var TranslatedFont = function TranslatedFontClosure() {
     this.sent = false;
   }
   TranslatedFont.prototype = {
-    send: function (handler) {
+    send: function send(handler) {
       if (this.sent) {
         return;
       }
@@ -1928,7 +1928,7 @@ var TranslatedFont = function TranslatedFontClosure() {
       handler.send('commonobj', [this.loadedName, 'Font', fontData]);
       this.sent = true;
     },
-    loadType3Data: function (evaluator, resources, parentOperatorList, task) {
+    loadType3Data: function loadType3Data(evaluator, resources, parentOperatorList, task) {
       assert(this.font.isType3Font);
       if (this.type3Loaded) {
         return this.type3Loaded;
@@ -2001,7 +2001,7 @@ var OperatorList = function OperatorListClosure() {
     get totalLength() {
       return this._totalLength + this.length;
     },
-    addOp: function (fn, args) {
+    addOp: function addOp(fn, args) {
       this.fnArray.push(fn);
       this.argsArray.push(args);
       if (this.messageHandler) {
@@ -2012,32 +2012,32 @@ var OperatorList = function OperatorListClosure() {
         }
       }
     },
-    addDependency: function (dependency) {
+    addDependency: function addDependency(dependency) {
       if (dependency in this.dependencies) {
         return;
       }
       this.dependencies[dependency] = true;
       this.addOp(OPS.dependency, [dependency]);
     },
-    addDependencies: function (dependencies) {
+    addDependencies: function addDependencies(dependencies) {
       for (var key in dependencies) {
         this.addDependency(key);
       }
     },
-    addOpList: function (opList) {
+    addOpList: function addOpList(opList) {
       Util.extendObj(this.dependencies, opList.dependencies);
       for (var i = 0, ii = opList.length; i < ii; i++) {
         this.addOp(opList.fnArray[i], opList.argsArray[i]);
       }
     },
-    getIR: function () {
+    getIR: function getIR() {
       return {
         fnArray: this.fnArray,
         argsArray: this.argsArray,
         length: this.length
       };
     },
-    flush: function (lastChunk) {
+    flush: function flush(lastChunk) {
       if (this.intent !== 'oplist') {
         new QueueOptimizer().optimize(this);
       }
@@ -2067,18 +2067,18 @@ var StateManager = function StateManagerClosure() {
     this.stateStack = [];
   }
   StateManager.prototype = {
-    save: function () {
+    save: function save() {
       var old = this.state;
       this.stateStack.push(this.state);
       this.state = old.clone();
     },
-    restore: function () {
+    restore: function restore() {
       var prev = this.stateStack.pop();
       if (prev) {
         this.state = prev;
       }
     },
-    transform: function (args) {
+    transform: function transform(args) {
       this.state.ctm = Util.transform(this.state.ctm, args);
     }
   };

+ 6 - 6
lib/core/font_renderer.js

@@ -641,7 +641,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
     this.fontMatrix = fontMatrix;
   }
   CompiledFont.prototype = {
-    getPathJs: function (unicode) {
+    getPathJs: function getPathJs(unicode) {
       var cmap = lookupCmap(this.cmap, unicode);
       var fn = this.compiledGlyphs[cmap.glyphId];
       if (!fn) {
@@ -653,7 +653,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
       }
       return fn;
     },
-    compileGlyph: function (code) {
+    compileGlyph: function compileGlyph(code) {
       if (!code || code.length === 0 || code[0] === 14) {
         return noop;
       }
@@ -671,10 +671,10 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
       cmds.push({ cmd: 'restore' });
       return cmds;
     },
-    compileGlyphImpl: function () {
+    compileGlyphImpl: function compileGlyphImpl() {
       error('Children classes should implement this.');
     },
-    hasBuiltPath: function (unicode) {
+    hasBuiltPath: function hasBuiltPath(unicode) {
       var cmap = lookupCmap(this.cmap, unicode);
       return this.compiledGlyphs[cmap.glyphId] !== undefined && this.compiledCharCodeToGlyphId[cmap.charCode] !== undefined;
     }
@@ -686,7 +686,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
     this.cmap = cmap;
   }
   Util.inherit(TrueTypeCompiled, CompiledFont, {
-    compileGlyphImpl: function (code, cmds) {
+    compileGlyphImpl: function compileGlyphImpl(code, cmds) {
       compileGlyf(code, cmds, this);
     }
   });
@@ -702,7 +702,7 @@ var FontRendererFactory = function FontRendererFactoryClosure() {
     this.subrsBias = this.subrs.length < 1240 ? 107 : this.subrs.length < 33900 ? 1131 : 32768;
   }
   Util.inherit(Type2Compiled, CompiledFont, {
-    compileGlyphImpl: function (code, cmds) {
+    compileGlyphImpl: function compileGlyphImpl(code, cmds) {
       compileCharString(code, cmds, this);
     }
   });

+ 11 - 11
lib/core/fonts.js

@@ -180,21 +180,21 @@ var ToUnicodeMap = function ToUnicodeMapClosure() {
     get length() {
       return this._map.length;
     },
-    forEach: function (callback) {
+    forEach: function forEach(callback) {
       for (var charCode in this._map) {
         callback(charCode, this._map[charCode].charCodeAt(0));
       }
     },
-    has: function (i) {
+    has: function has(i) {
       return this._map[i] !== undefined;
     },
-    get: function (i) {
+    get: function get(i) {
       return this._map[i];
     },
-    charCodeOf: function (v) {
+    charCodeOf: function charCodeOf(v) {
       return this._map.indexOf(v);
     },
-    amend: function (map) {
+    amend: function amend(map) {
       for (var charCode in map) {
         this._map[charCode] = map[charCode];
       }
@@ -211,24 +211,24 @@ var IdentityToUnicodeMap = function IdentityToUnicodeMapClosure() {
     get length() {
       return this.lastChar + 1 - this.firstChar;
     },
-    forEach: function (callback) {
+    forEach: function forEach(callback) {
       for (var i = this.firstChar, ii = this.lastChar; i <= ii; i++) {
         callback(i, i);
       }
     },
-    has: function (i) {
+    has: function has(i) {
       return this.firstChar <= i && i <= this.lastChar;
     },
-    get: function (i) {
+    get: function get(i) {
       if (this.firstChar <= i && i <= this.lastChar) {
         return String.fromCharCode(i);
       }
       return undefined;
     },
-    charCodeOf: function (v) {
+    charCodeOf: function charCodeOf(v) {
       return isInt(v) && v >= this.firstChar && v <= this.lastChar ? v : -1;
     },
-    amend: function (map) {
+    amend: function amend(map) {
       error('Should not call amend()');
     }
   };
@@ -1655,7 +1655,7 @@ var Font = function FontClosure() {
         maxFunctionDefs = font.getUint16();
       }
       var dupFirstEntry = false;
-      if (properties.type === 'CIDFontType2' && properties.toUnicode && properties.toUnicode.get(0) > '\u0000') {
+      if (properties.type === 'CIDFontType2' && properties.toUnicode && properties.toUnicode.get(0) > '\0') {
         dupFirstEntry = true;
         numGlyphs++;
         tables['maxp'].data[4] = numGlyphs >> 8;

+ 10 - 8
lib/core/function.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var sharedUtil = require('../shared/util.js');
 var corePrimitives = require('./primitives.js');
 var corePsParser = require('./ps_parser.js');
@@ -355,7 +357,7 @@ var PDFFunction = function PDFFunctionClosure() {
 }();
 function isPDFFunction(v) {
   var fnDict;
-  if (typeof v !== 'object') {
+  if ((typeof v === 'undefined' ? 'undefined' : _typeof(v)) !== 'object') {
     return false;
   } else if (isDict(v)) {
     fnDict = v;
@@ -726,35 +728,35 @@ var PostScriptCompiler = function PostScriptCompilerClosure() {
     this.parts = [];
   }
   ExpressionBuilderVisitor.prototype = {
-    visitArgument: function (arg) {
+    visitArgument: function visitArgument(arg) {
       this.parts.push('Math.max(', arg.min, ', Math.min(', arg.max, ', src[srcOffset + ', arg.index, ']))');
     },
-    visitVariable: function (variable) {
+    visitVariable: function visitVariable(variable) {
       this.parts.push('v', variable.index);
     },
-    visitLiteral: function (literal) {
+    visitLiteral: function visitLiteral(literal) {
       this.parts.push(literal.number);
     },
-    visitBinaryOperation: function (operation) {
+    visitBinaryOperation: function visitBinaryOperation(operation) {
       this.parts.push('(');
       operation.arg1.visit(this);
       this.parts.push(' ', operation.op, ' ');
       operation.arg2.visit(this);
       this.parts.push(')');
     },
-    visitVariableDefinition: function (definition) {
+    visitVariableDefinition: function visitVariableDefinition(definition) {
       this.parts.push('var ');
       definition.variable.visit(this);
       this.parts.push(' = ');
       definition.arg.visit(this);
       this.parts.push(';');
     },
-    visitMin: function (max) {
+    visitMin: function visitMin(max) {
       this.parts.push('Math.min(');
       max.arg.visit(this);
       this.parts.push(', ', max.max, ')');
     },
-    toString: function () {
+    toString: function toString() {
       return this.parts.join('');
     }
   };

+ 1 - 1
lib/core/jbig2.js

@@ -26,7 +26,7 @@ var ArithmeticDecoder = coreArithmeticDecoder.ArithmeticDecoder;
 var Jbig2Image = function Jbig2ImageClosure() {
   function ContextCache() {}
   ContextCache.prototype = {
-    getContexts: function (id) {
+    getContexts: function getContexts(id) {
       if (id in this) {
         return this[id];
       }

+ 3 - 1
lib/core/jpg.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var sharedUtil = require('../shared/util.js');
 var warn = sharedUtil.warn;
 var error = sharedUtil.error;
@@ -107,7 +109,7 @@ var JpegImage = function JpegImageClosure() {
         if (typeof node === 'number') {
           return node;
         }
-        if (typeof node !== 'object') {
+        if ((typeof node === 'undefined' ? 'undefined' : _typeof(node)) !== 'object') {
           error('JPEG error: invalid huffman sequence');
         }
       }

+ 3 - 1
lib/core/murmurhash3.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var sharedUtil = require('../shared/util.js');
 var MurmurHash3_64 = function MurmurHash3_64Closure(seed) {
   var MASK_HIGH = 0xffff0000;
@@ -38,7 +40,7 @@ var MurmurHash3_64 = function MurmurHash3_64Closure(seed) {
             data[length++] = code & 0xff;
           }
         }
-      } else if (typeof input === 'object' && 'byteLength' in input) {
+      } else if ((typeof input === 'undefined' ? 'undefined' : _typeof(input)) === 'object' && 'byteLength' in input) {
         data = input;
         length = data.byteLength;
       } else {

+ 3 - 1
lib/core/obj.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var sharedUtil = require('../shared/util.js');
 var corePrimitives = require('./primitives.js');
 var coreCrypto = require('./crypto.js');
@@ -542,7 +544,7 @@ var Catalog = function CatalogClosure() {
       return;
     }
     var resultObj = params.resultObj;
-    if (typeof resultObj !== 'object') {
+    if ((typeof resultObj === 'undefined' ? 'undefined' : _typeof(resultObj)) !== 'object') {
       warn('Catalog_parseDestDictionary: "resultObj" must be an object.');
       return;
     }

+ 3 - 1
lib/core/primitives.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var sharedUtil = require('../shared/util.js');
 var isArray = sharedUtil.isArray;
 var EOF = {};
@@ -224,7 +226,7 @@ function isRefsEqual(v1, v2) {
   return v1.num === v2.num && v1.gen === v2.gen;
 }
 function isStream(v) {
-  return typeof v === 'object' && v !== null && v.getBytes !== undefined;
+  return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v !== null && v.getBytes !== undefined;
 }
 exports.EOF = EOF;
 exports.Cmd = Cmd;

+ 1 - 1
lib/core/type1_parser.js

@@ -235,7 +235,7 @@ var Type1CharString = function Type1CharStringClosure() {
       }
       return error;
     },
-    executeCommand: function (howManyArgs, command, keepStack) {
+    executeCommand: function executeCommand(howManyArgs, command, keepStack) {
       var stackLength = this.stack.length;
       if (howManyArgs > stackLength) {
         return true;

+ 10 - 8
lib/core/worker.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var sharedUtil = require('../shared/util.js');
 var corePrimitives = require('./primitives.js');
 var corePdfManager = require('./pdf_manager.js');
@@ -46,13 +48,13 @@ var WorkerTask = function WorkerTaskClosure() {
     get finished() {
       return this._capability.promise;
     },
-    finish: function () {
+    finish: function finish() {
       this._capability.resolve();
     },
-    terminate: function () {
+    terminate: function terminate() {
       this.terminated = true;
     },
-    ensureNotTerminated: function () {
+    ensureNotTerminated: function ensureNotTerminated() {
       if (this.terminated) {
         throw new Error('Worker task was terminated');
       }
@@ -410,7 +412,7 @@ var WorkerMessageHandler = {
       });
       var cachedChunks = [],
           loaded = 0;
-      var flushChunks = function () {
+      var flushChunks = function flushChunks() {
         var pdfFile = arraysToBytes(cachedChunks);
         if (source.length && pdfFile.length !== source.length) {
           warn('reported HTTP length is different from actual');
@@ -424,7 +426,7 @@ var WorkerMessageHandler = {
         cachedChunks = [];
       };
       var readPromise = new Promise(function (resolve, reject) {
-        var readChunk = function (chunk) {
+        var readChunk = function readChunk(chunk) {
           try {
             ensureNotTerminated();
             if (chunk.done) {
@@ -458,7 +460,7 @@ var WorkerMessageHandler = {
         pdfManagerCapability.reject(e);
         cancelXHRs = null;
       });
-      cancelXHRs = function () {
+      cancelXHRs = function cancelXHRs() {
         pdfStream.cancelAllRequests('abort');
       };
       return pdfManagerCapability.promise;
@@ -604,14 +606,14 @@ var WorkerMessageHandler = {
               message: e,
               stack: minimumStackMessage
             };
-          } else if (typeof e === 'object') {
+          } else if ((typeof e === 'undefined' ? 'undefined' : _typeof(e)) === 'object') {
             wrappedException = {
               message: e.message || e.toString(),
               stack: e.stack || minimumStackMessage
             };
           } else {
             wrappedException = {
-              message: 'Unknown exception type: ' + typeof e,
+              message: 'Unknown exception type: ' + (typeof e === 'undefined' ? 'undefined' : _typeof(e)),
               stack: minimumStackMessage
             };
           }

+ 17 - 15
lib/display/api.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var sharedUtil = require('../shared/util.js');
 var displayFontLoader = require('./font_loader.js');
 var displayCanvas = require('./canvas.js');
@@ -109,7 +111,7 @@ function getDocument(src, pdfDataRangeTransport, passwordCallback, progressCallb
   } else if (src instanceof PDFDataRangeTransport) {
     source = { range: src };
   } else {
-    if (typeof src !== 'object') {
+    if ((typeof src === 'undefined' ? 'undefined' : _typeof(src)) !== 'object') {
       error('Invalid parameter in getDocument, need either Uint8Array, ' + 'string or a parameter object');
     }
     if (!src.url && !src.data && !src.range) {
@@ -134,7 +136,7 @@ function getDocument(src, pdfDataRangeTransport, passwordCallback, progressCallb
       var pdfBytes = source[key];
       if (typeof pdfBytes === 'string') {
         params[key] = stringToBytes(pdfBytes);
-      } else if (typeof pdfBytes === 'object' && pdfBytes !== null && !isNaN(pdfBytes.length)) {
+      } else if ((typeof pdfBytes === 'undefined' ? 'undefined' : _typeof(pdfBytes)) === 'object' && pdfBytes !== null && !isNaN(pdfBytes.length)) {
         params[key] = new Uint8Array(pdfBytes);
       } else if (isArrayBuffer(pdfBytes)) {
         params[key] = new Uint8Array(pdfBytes);
@@ -216,7 +218,7 @@ var PDFDocumentLoadingTask = function PDFDocumentLoadingTaskClosure() {
     get promise() {
       return this._capability.promise;
     },
-    destroy: function () {
+    destroy: function destroy() {
       this.destroyed = true;
       var transportDestroyed = !this._transport ? Promise.resolve() : this._transport.destroy();
       return transportDestroyed.then(function () {
@@ -516,7 +518,7 @@ var PDFPageProxy = function PDFPageProxyClosure() {
       this.pendingCleanup = false;
       return Promise.all(waitOn);
     },
-    destroy: function () {
+    destroy: function destroy() {
       deprecated('page destroy method, use cleanup() instead');
       this.cleanup();
     },
@@ -598,9 +600,9 @@ var PDFWorker = function PDFWorkerClosure() {
     this._deferred = Promise.resolve(undefined);
   }
   FakeWorkerPort.prototype = {
-    postMessage: function (obj, transfers) {
+    postMessage: function postMessage(obj, transfers) {
       function cloneValue(value) {
-        if (typeof value !== 'object' || value === null) {
+        if ((typeof value === 'undefined' ? 'undefined' : _typeof(value)) !== 'object' || value === null) {
           return value;
         }
         if (cloned.has(value)) {
@@ -649,14 +651,14 @@ var PDFWorker = function PDFWorkerClosure() {
         }, this);
       }.bind(this));
     },
-    addEventListener: function (name, listener) {
+    addEventListener: function addEventListener(name, listener) {
       this._listeners.push(listener);
     },
-    removeEventListener: function (name, listener) {
+    removeEventListener: function removeEventListener(name, listener) {
       var i = this._listeners.indexOf(listener);
       this._listeners.splice(i, 1);
     },
-    terminate: function () {
+    terminate: function terminate() {
       this._listeners = [];
     }
   };
@@ -758,7 +760,7 @@ var PDFWorker = function PDFWorkerClosure() {
               this._setupFakeWorker();
             }
           }.bind(this));
-          var sendTest = function () {
+          var sendTest = function sendTest() {
             var postMessageTransfers = getDefaultSetting('postMessageTransfers') && !isPostMessageTransfersDisabled;
             var testObj = new Uint8Array([postMessageTransfers ? 255 : 0]);
             try {
@@ -967,7 +969,7 @@ var WorkerTransport = function WorkerTransportClosure() {
             var fontRegistry = null;
             if (getDefaultSetting('pdfBug') && globalScope.FontInspector && globalScope['FontInspector'].enabled) {
               fontRegistry = {
-                registerFont: function (font, url) {
+                registerFont: function registerFont(font, url) {
                   globalScope['FontInspector'].fontAdded(font, url);
                 }
               };
@@ -1368,19 +1370,19 @@ var InternalRenderTask = function InternalRenderTaskClosure() {
 var _UnsupportedManager = function UnsupportedManagerClosure() {
   var listeners = [];
   return {
-    listen: function (cb) {
+    listen: function listen(cb) {
       deprecated('Global UnsupportedManager.listen is used: ' + ' use PDFDocumentLoadingTask.onUnsupportedFeature instead');
       listeners.push(cb);
     },
-    notify: function (featureId) {
+    notify: function notify(featureId) {
       for (var i = 0, ii = listeners.length; i < ii; i++) {
         listeners[i](featureId);
       }
     }
   };
 }();
-exports.version = '1.8.205';
-exports.build = 'bc1f4dd9';
+exports.version = '1.8.207';
+exports.build = 'fd51a7cb';
 exports.getDocument = getDocument;
 exports.PDFDataRangeTransport = PDFDataRangeTransport;
 exports.PDFWorker = PDFWorker;

+ 3 - 3
lib/display/canvas.js

@@ -143,7 +143,7 @@ var CachedCanvases = function CachedCanvasesClosure() {
       }
       return canvasEntry;
     },
-    clear: function () {
+    clear: function clear() {
       for (var id in this.cache) {
         var canvasEntry = this.cache[id];
         this.canvasFactory.destroy(canvasEntry);
@@ -272,7 +272,7 @@ function compileType3Glyph(imgData) {
     outlines.push(coords);
     --i;
   }
-  var drawOutline = function (c) {
+  var drawOutline = function drawOutline(c) {
     c.save();
     c.scale(1 / width, -1 / height);
     c.translate(0, -height);
@@ -1287,7 +1287,7 @@ var CanvasGraphics = function CanvasGraphicsClosure() {
         var baseTransform = this.baseTransform || this.ctx.mozCurrentTransform.slice();
         var self = this;
         var canvasGraphicsFactory = {
-          createCanvasGraphics: function (ctx) {
+          createCanvasGraphics: function createCanvasGraphics(ctx) {
             return new CanvasGraphics(ctx, self.commonObjs, self.objs, self.canvasFactory);
           }
         };

+ 1 - 1
lib/display/dom_utils.js

@@ -56,7 +56,7 @@ var DOMCMapReaderFactory = function DOMCMapReaderFactoryClosure() {
     this.isCompressed = params.isCompressed || false;
   }
   DOMCMapReaderFactory.prototype = {
-    fetch: function (params) {
+    fetch: function fetch(params) {
       var name = params.name;
       if (!name) {
         return Promise.reject(new Error('CMap name must be specified.'));

+ 4 - 4
lib/display/font_loader.js

@@ -52,11 +52,11 @@ FontLoader.prototype = {
     this.nativeFontFaces.length = 0;
   }
 };
-var getLoadTestFont = function () {
+var getLoadTestFont = function getLoadTestFont() {
   return atob('T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQ' + 'AABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwA' + 'AAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbm' + 'FtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAA' + 'AADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6A' + 'ABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAA' + 'MQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAA' + 'AAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAA' + 'AAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQ' + 'AAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMA' + 'AQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAA' + 'EAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAA' + 'AQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' + 'AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAA' + 'AAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgc' + 'A/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWF' + 'hYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQA' + 'AAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAg' + 'ABAAAAAAAAAAAD6AAAAAAAAA==');
 };
 Object.defineProperty(FontLoader.prototype, 'loadTestFont', {
-  get: function () {
+  get: function get() {
     return shadow(this, 'loadTestFont', getLoadTestFont());
   },
   configurable: true
@@ -69,7 +69,7 @@ FontLoader.prototype.bind = function fontLoaderBind(fonts, callback) {
   var rules = [];
   var fontsToLoad = [];
   var fontLoadPromises = [];
-  var getNativeFontPromise = function (nativeFontFace) {
+  var getNativeFontPromise = function getNativeFontPromise(nativeFontFace) {
     return nativeFontFace.loaded.catch(function (e) {
       warn('Failed to load font "' + nativeFontFace.family + '": ' + e);
     });
@@ -207,7 +207,7 @@ var isSyncFontLoadingSupported = function isSyncFontLoadingSupported() {
   return supported;
 };
 Object.defineProperty(FontLoader, 'isSyncFontLoadingSupported', {
-  get: function () {
+  get: function get() {
     return shadow(FontLoader, 'isSyncFontLoadingSupported', isSyncFontLoadingSupported());
   },
   enumerable: true,

+ 6 - 6
lib/display/global.js

@@ -31,18 +31,18 @@ if (!globalScope.PDFJS) {
   globalScope.PDFJS = {};
 }
 var PDFJS = globalScope.PDFJS;
-PDFJS.version = '1.8.205';
-PDFJS.build = 'bc1f4dd9';
+PDFJS.version = '1.8.207';
+PDFJS.build = 'fd51a7cb';
 PDFJS.pdfBug = false;
 if (PDFJS.verbosity !== undefined) {
   sharedUtil.setVerbosityLevel(PDFJS.verbosity);
 }
 delete PDFJS.verbosity;
 Object.defineProperty(PDFJS, 'verbosity', {
-  get: function () {
+  get: function get() {
     return sharedUtil.getVerbosityLevel();
   },
-  set: function (level) {
+  set: function set(level) {
     sharedUtil.setVerbosityLevel(level);
   },
   enumerable: true,
@@ -96,10 +96,10 @@ PDFJS.pdfjsNext = PDFJS.pdfjsNext === undefined ? false : PDFJS.pdfjsNext;
 var savedOpenExternalLinksInNewWindow = PDFJS.openExternalLinksInNewWindow;
 delete PDFJS.openExternalLinksInNewWindow;
 Object.defineProperty(PDFJS, 'openExternalLinksInNewWindow', {
-  get: function () {
+  get: function get() {
     return PDFJS.externalLinkTarget === LinkTarget.BLANK;
   },
-  set: function (value) {
+  set: function set(value) {
     if (value) {
       deprecated('PDFJS.openExternalLinksInNewWindow, please use ' + '"PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK" instead.');
     }

+ 1 - 1
lib/display/text_layer.js

@@ -208,7 +208,7 @@ var renderTextLayer = function renderTextLayerClosure() {
         ts[i + 56] = s && (e.right - t[0]) / s;
         ts[i + 60] = c && (e.bottom - t[1]) / -c;
       });
-      var findPositiveMin = function (ts, offset, count) {
+      var findPositiveMin = function findPositiveMin(ts, offset, count) {
         var result = 0;
         for (var i = 0; i < count; i++) {
           var t = ts[offset++];

+ 2 - 2
lib/pdf.js

@@ -14,8 +14,8 @@
  */
 'use strict';
 
-var pdfjsVersion = '1.8.205';
-var pdfjsBuild = 'bc1f4dd9';
+var pdfjsVersion = '1.8.207';
+var pdfjsBuild = 'fd51a7cb';
 var pdfjsSharedUtil = require('./shared/util.js');
 var pdfjsDisplayGlobal = require('./display/global.js');
 var pdfjsDisplayAPI = require('./display/api.js');

+ 2 - 2
lib/pdf.worker.js

@@ -14,8 +14,8 @@
  */
 'use strict';
 
-var pdfjsVersion = '1.8.205';
-var pdfjsBuild = 'bc1f4dd9';
+var pdfjsVersion = '1.8.207';
+var pdfjsBuild = 'fd51a7cb';
 var pdfjsCoreWorker = require('./core/worker.js');
 {
   require('./core/network.js');

+ 28 - 26
lib/shared/compatibility.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
   var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : undefined;
   var userAgent = typeof navigator !== 'undefined' && navigator.userAgent || '';
@@ -27,7 +29,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
   var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent);
   var isOpera = userAgent.indexOf('Opera') >= 0;
   var isSafari = /Safari\//.test(userAgent) && !/(Chrome\/|Android\s)/.test(userAgent);
-  var hasDOM = typeof window === 'object' && typeof document === 'object';
+  var hasDOM = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object';
   if (typeof PDFJS === 'undefined') {
     globalScope.PDFJS = {};
   }
@@ -68,12 +70,12 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
     var uint32ArrayViewSetters = 0;
     function createUint32ArrayProp(index) {
       return {
-        get: function () {
+        get: function get() {
           var buffer = this.buffer,
               offset = index << 2;
           return (buffer[offset] | buffer[offset + 1] << 8 | buffer[offset + 2] << 16 | buffer[offset + 3] << 24) >>> 0;
         },
-        set: function (value) {
+        set: function set(value) {
           var buffer = this.buffer,
               offset = index << 2;
           buffer[offset] = value & 255;
@@ -108,7 +110,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       result.buffer = result;
       result.byteLength = result.length;
       result.set = setArrayOffset;
-      if (typeof arg1 === 'object' && arg1.buffer) {
+      if ((typeof arg1 === 'undefined' ? 'undefined' : _typeof(arg1)) === 'object' && arg1.buffer) {
         result.buffer = arg1.buffer;
       }
       return result;
@@ -138,14 +140,14 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     Object.defineProperty(cpaProto, 'buffer', {
-      get: function () {
+      get: function get() {
         return this;
       },
       enumerable: false,
       configurable: true
     });
     Object.defineProperty(cpaProto, 'byteLength', {
-      get: function () {
+      get: function get() {
         return this.length;
       },
       enumerable: false,
@@ -314,7 +316,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     Object.defineProperty(HTMLElement.prototype, 'dataset', {
-      get: function () {
+      get: function get() {
         if (this._dataset) {
           return this._dataset;
         }
@@ -364,21 +366,21 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     var classListPrototype = {
-      add: function (name) {
+      add: function add(name) {
         changeList(this.element, name, true, false);
       },
-      contains: function (name) {
+      contains: function contains(name) {
         return changeList(this.element, name, false, false);
       },
-      remove: function (name) {
+      remove: function remove(name) {
         changeList(this.element, name, false, true);
       },
-      toggle: function (name) {
+      toggle: function toggle(name) {
         changeList(this.element, name, true, true);
       }
     };
     Object.defineProperty(HTMLElement.prototype, 'classList', {
-      get: function () {
+      get: function get() {
         if (this._classList) {
           return this._classList;
         }
@@ -440,9 +442,9 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
     }
     if (!('console' in window)) {
       window.console = {
-        log: function () {},
-        error: function () {},
-        warn: function () {}
+        log: function log() {},
+        error: function error() {},
+        warn: function warn() {}
       };
       return;
     }
@@ -592,7 +594,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     Object.defineProperty(document, 'currentScript', {
-      get: function () {
+      get: function get() {
         var scripts = document.getElementsByTagName('script');
         return scripts[scripts.length - 1];
       },
@@ -611,10 +613,10 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       var inputProto = el.constructor.prototype;
       var typeProperty = Object.getOwnPropertyDescriptor(inputProto, 'type');
       Object.defineProperty(inputProto, 'type', {
-        get: function () {
+        get: function get() {
           return typeProperty.get.call(this);
         },
-        set: function (value) {
+        set: function set(value) {
           typeProperty.set.call(this, value === 'number' ? 'text' : value);
         },
         enumerable: true,
@@ -632,11 +634,11 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
     var documentProto = document.constructor.prototype;
     var readyStateProto = Object.getOwnPropertyDescriptor(documentProto, 'readyState');
     Object.defineProperty(documentProto, 'readyState', {
-      get: function () {
+      get: function get() {
         var value = readyStateProto.get.call(this);
         return value === 'interactive' ? 'loading' : value;
       },
-      set: function (value) {
+      set: function set(value) {
         readyStateProto.set.call(this, value);
       },
       enumerable: true,
@@ -925,20 +927,20 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       this.id = '$weakmap' + id++;
     }
     WeakMap.prototype = {
-      has: function (obj) {
+      has: function has(obj) {
         return !!Object.getOwnPropertyDescriptor(obj, this.id);
       },
-      get: function (obj, defaultValue) {
+      get: function get(obj, defaultValue) {
         return this.has(obj) ? obj[this.id] : defaultValue;
       },
-      set: function (obj, value) {
+      set: function set(obj, value) {
         Object.defineProperty(obj, this.id, {
           value: value,
           enumerable: false,
           configurable: true
         });
       },
-      delete: function (obj) {
+      delete: function _delete(obj) {
         delete obj[this.id];
       }
     };
@@ -947,7 +949,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
   (function checkURLConstructor() {
     var hasWorkingUrl = false;
     try {
-      if (typeof URL === 'function' && typeof URL.prototype === 'object' && 'origin' in URL.prototype) {
+      if (typeof URL === 'function' && _typeof(URL.prototype) === 'object' && 'origin' in URL.prototype) {
         var u = new URL('b', 'http://a');
         u.pathname = 'c%20d';
         hasWorkingUrl = u.href === 'http://a/c%20d';
@@ -1369,7 +1371,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       parse.call(this, input, null, base);
     }
     JURL.prototype = {
-      toString: function () {
+      toString: function toString() {
         return this.href;
       },
       get href() {

+ 7 - 5
lib/shared/util.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var compatibility = require('./compatibility.js');
 var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : undefined;
 var FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];
@@ -426,7 +428,7 @@ function removeNullCharacters(str) {
   return str.replace(NullCharactersRegExp, '');
 }
 function bytesToString(bytes) {
-  assert(bytes !== null && typeof bytes === 'object' && bytes.length !== undefined, 'Invalid argument for bytesToString');
+  assert(bytes !== null && (typeof bytes === 'undefined' ? 'undefined' : _typeof(bytes)) === 'object' && bytes.length !== undefined, 'Invalid argument for bytesToString');
   var length = bytes.length;
   var MAX_ARGUMENT_COUNT = 8192;
   if (length < MAX_ARGUMENT_COUNT) {
@@ -797,14 +799,14 @@ function isArray(v) {
   return v instanceof Array;
 }
 function isArrayBuffer(v) {
-  return typeof v === 'object' && v !== null && v.byteLength !== undefined;
+  return (typeof v === 'undefined' ? 'undefined' : _typeof(v)) === 'object' && v !== null && v.byteLength !== undefined;
 }
 function isSpace(ch) {
   return ch === 0x20 || ch === 0x09 || ch === 0x0D || ch === 0x0A;
 }
 function isNodeJS() {
   if (typeof __pdfjsdev_webpack__ === 'undefined') {
-    return typeof process === 'object' && process + '' === '[object process]';
+    return (typeof process === 'undefined' ? 'undefined' : _typeof(process)) === 'object' && process + '' === '[object process]';
   }
   return false;
 }
@@ -997,14 +999,14 @@ MessageHandler.prototype = {
     }
     return capability.promise;
   },
-  postMessage: function (message, transfers) {
+  postMessage: function postMessage(message, transfers) {
     if (transfers && this.postMessageTransfers) {
       this.comObj.postMessage(message, transfers);
     } else {
       this.comObj.postMessage(message);
     }
   },
-  destroy: function () {
+  destroy: function destroy() {
     this.comObj.removeEventListener('message', this._onComObjOnMessage);
   }
 };

+ 3 - 3
lib/test/unit/annotation_spec.js

@@ -46,10 +46,10 @@ describe('annotation', function () {
     }
   }
   XRefMock.prototype = {
-    fetch: function (ref) {
+    fetch: function fetch(ref) {
       return this.map[ref.toString()];
     },
-    fetchIfRef: function (obj) {
+    fetchIfRef: function fetchIfRef(obj) {
       if (!isRef(obj)) {
         return obj;
       }
@@ -64,7 +64,7 @@ describe('annotation', function () {
     var uniquePrefix = params.prefix || 'p0_';
     var idCounters = { obj: params.startObjId || 0 };
     return {
-      createObjId: function () {
+      createObjId: function createObjId() {
         return uniquePrefix + ++idCounters.obj;
       }
     };

+ 6 - 4
lib/test/unit/api_spec.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var sharedUtil = require('../../shared/util.js');
 var displayDOMUtils = require('../../display/dom_utils.js');
 var displayGlobal = require('../../display/global.js');
@@ -356,7 +358,7 @@ describe('api', function () {
     });
     it('gets fingerprint', function () {
       var fingerprint = doc.fingerprint;
-      expect(typeof fingerprint).toEqual('string');
+      expect(typeof fingerprint === 'undefined' ? 'undefined' : _typeof(fingerprint)).toEqual('string');
       expect(fingerprint.length > 0).toEqual(true);
     });
     it('gets page', function (done) {
@@ -662,7 +664,7 @@ describe('api', function () {
           expect(outline instanceof Array).toEqual(true);
           expect(outline.length).toEqual(5);
           var outlineItemTwo = outline[2];
-          expect(typeof outlineItemTwo.title).toEqual('string');
+          expect(_typeof(outlineItemTwo.title)).toEqual('string');
           expect(outlineItemTwo.dest).toEqual(null);
           expect(outlineItemTwo.url).toEqual('http://google.com/');
           expect(outlineItemTwo.unsafeUrl).toEqual('http://google.com');
@@ -728,10 +730,10 @@ describe('api', function () {
       var promises = [loadingTask1.promise, loadingTask2.promise];
       Promise.all(promises).then(function (data) {
         var fingerprint1 = data[0].fingerprint;
-        expect(typeof fingerprint1).toEqual('string');
+        expect(typeof fingerprint1 === 'undefined' ? 'undefined' : _typeof(fingerprint1)).toEqual('string');
         expect(fingerprint1.length > 0).toEqual(true);
         var fingerprint2 = data[1].fingerprint;
-        expect(typeof fingerprint2).toEqual('string');
+        expect(typeof fingerprint2 === 'undefined' ? 'undefined' : _typeof(fingerprint2)).toEqual('string');
         expect(fingerprint2.length > 0).toEqual(true);
         expect(fingerprint1).not.toEqual(fingerprint2);
         loadingTask1.destroy();

+ 1 - 1
lib/test/unit/cff_parser_spec.js

@@ -108,7 +108,7 @@ describe('CFFParser', function () {
     parser.bytes = bytes;
     var topDict = cff.topDict;
     topDict.setByName('Private', [bytes.length, 0]);
-    var parsePrivateDict = function () {
+    var parsePrivateDict = function parsePrivateDict() {
       parser.parsePrivateDict(topDict);
     };
     expect(parsePrivateDict).not.toThrow();

+ 1 - 1
lib/test/unit/cmap_spec.js

@@ -48,7 +48,7 @@ describe('cmap', function () {
         isCompressed: cMapPacked
       });
     }
-    fetchBuiltInCMap = function (name) {
+    fetchBuiltInCMap = function fetchBuiltInCMap(name) {
       return CMapReaderFactory.fetch({ name: name });
     };
     done();

+ 4 - 4
lib/test/unit/evaluator_spec.js

@@ -32,7 +32,7 @@ describe('evaluator', function () {
     this.queue = queue || [];
   }
   XrefMock.prototype = {
-    fetchIfRef: function () {
+    fetchIfRef: function fetchIfRef() {
       return this.queue.shift();
     }
   };
@@ -40,7 +40,7 @@ describe('evaluator', function () {
     this.inputs = [];
   }
   HandlerMock.prototype = {
-    send: function (name, data) {
+    send: function send(name, data) {
       this.inputs.push({
         name: name,
         data: data
@@ -49,7 +49,7 @@ describe('evaluator', function () {
   };
   function ResourcesMock() {}
   ResourcesMock.prototype = {
-    get: function (name) {
+    get: function get(name) {
       return this[name];
     }
   };
@@ -268,7 +268,7 @@ describe('evaluator', function () {
   describe('operator list', function () {
     function MessageHandlerMock() {}
     MessageHandlerMock.prototype = {
-      send: function () {}
+      send: function send() {}
     };
     it('should get correct total length after flushing', function () {
       var operatorList = new OperatorList(null, new MessageHandlerMock());

+ 2 - 2
lib/test/unit/function_spec.js

@@ -27,9 +27,9 @@ var isArray = sharedUtil.isArray;
 describe('function', function () {
   beforeEach(function () {
     jasmine.addMatchers({
-      toMatchArray: function (util, customEqualityTesters) {
+      toMatchArray: function toMatchArray(util, customEqualityTesters) {
         return {
-          compare: function (actual, expected) {
+          compare: function compare(actual, expected) {
             var result = {};
             if (actual.length !== expected.length) {
               result.pass = false;

+ 9 - 9
lib/test/unit/jasmine-boot.js

@@ -31,7 +31,7 @@ function initializePDFJS(callback) {
   var jasmineInterface = jasmineRequire.interface(jasmine, env);
   extend(window, jasmineInterface);
   var queryString = new jasmine.QueryString({
-    getWindowLocation: function () {
+    getWindowLocation: function getWindowLocation() {
       return window.location;
     }
   });
@@ -47,25 +47,25 @@ function initializePDFJS(callback) {
   }
   var htmlReporter = new jasmine.HtmlReporter({
     env: env,
-    onRaiseExceptionsClick: function () {
+    onRaiseExceptionsClick: function onRaiseExceptionsClick() {
       queryString.navigateWithNewParam('catch', !env.catchingExceptions());
     },
-    onThrowExpectationsClick: function () {
+    onThrowExpectationsClick: function onThrowExpectationsClick() {
       queryString.navigateWithNewParam('throwFailures', !env.throwingExpectationFailures());
     },
-    onRandomClick: function () {
+    onRandomClick: function onRandomClick() {
       queryString.navigateWithNewParam('random', !env.randomTests());
     },
-    addToExistingQueryString: function (key, value) {
+    addToExistingQueryString: function addToExistingQueryString(key, value) {
       return queryString.fullStringWithNewParam(key, value);
     },
-    getContainer: function () {
+    getContainer: function getContainer() {
       return document.body;
     },
-    createElement: function () {
+    createElement: function createElement() {
       return document.createElement.apply(document, arguments);
     },
-    createTextNode: function () {
+    createTextNode: function createTextNode() {
       return document.createTextNode.apply(document, arguments);
     },
     timer: new jasmine.Timer()
@@ -76,7 +76,7 @@ function initializePDFJS(callback) {
     env.addReporter(testReporter);
   }
   var specFilter = new jasmine.HtmlSpecFilter({
-    filterString: function () {
+    filterString: function filterString() {
       return queryString.getParam('spec');
     }
   });

+ 3 - 3
lib/test/unit/network_spec.js

@@ -38,7 +38,7 @@ describe('network', function () {
     });
     var len = 0,
         count = 0;
-    var read = function () {
+    var read = function read() {
       return fullReader.read().then(function (result) {
         if (result.done) {
           return;
@@ -83,7 +83,7 @@ describe('network', function () {
     });
     var len = 0,
         count = 0;
-    var read = function () {
+    var read = function read() {
       return fullReader.read().then(function (result) {
         if (result.done) {
           return;
@@ -128,7 +128,7 @@ describe('network', function () {
     var range2Reader = stream.getRangeReader(pdf1Length - tailSize, pdf1Length);
     var result1 = { value: 0 },
         result2 = { value: 0 };
-    var read = function (reader, lenResult) {
+    var read = function read(reader, lenResult) {
       return reader.read().then(function (result) {
         if (result.done) {
           return;

+ 6 - 6
lib/test/unit/primitives_spec.js

@@ -36,19 +36,19 @@ describe('primitives', function () {
     }
   }
   XRefMock.prototype = {
-    fetch: function (ref) {
+    fetch: function fetch(ref) {
       return this.map[ref.toString()];
     },
-    fetchIfRef: function (obj) {
+    fetchIfRef: function fetchIfRef(obj) {
       if (!isRef(obj)) {
         return obj;
       }
       return this.fetch(obj);
     },
-    fetchAsync: function (ref) {
+    fetchAsync: function fetchAsync(ref) {
       return Promise.resolve(this.fetch(ref));
     },
-    fetchIfRefAsync: function (obj) {
+    fetchIfRefAsync: function fetchIfRefAsync(obj) {
       return Promise.resolve(this.fetchIfRef(obj));
     }
   };
@@ -85,11 +85,11 @@ describe('primitives', function () {
     });
   });
   describe('Dict', function () {
-    var checkInvalidHasValues = function (dict) {
+    var checkInvalidHasValues = function checkInvalidHasValues(dict) {
       expect(dict.has()).toBeFalsy();
       expect(dict.has('Prev')).toBeFalsy();
     };
-    var checkInvalidKeyValues = function (dict) {
+    var checkInvalidKeyValues = function checkInvalidKeyValues(dict) {
       expect(dict.get()).toBeUndefined();
       expect(dict.get('Prev')).toBeUndefined();
       expect(dict.get('Decode', 'D')).toBeUndefined();

+ 2 - 2
lib/test/unit/stream_spec.js

@@ -22,9 +22,9 @@ var PredictorStream = coreStream.PredictorStream;
 describe('stream', function () {
   beforeEach(function () {
     jasmine.addMatchers({
-      toMatchTypedArray: function (util, customEqualityTesters) {
+      toMatchTypedArray: function toMatchTypedArray(util, customEqualityTesters) {
         return {
-          compare: function (actual, expected) {
+          compare: function compare(actual, expected) {
             var result = {};
             if (actual.length !== expected.length) {
               result.pass = false;

+ 1 - 1
lib/test/unit/test_utils.js

@@ -22,7 +22,7 @@ var NodeCMapReaderFactory = function NodeCMapReaderFactoryClosure() {
     this.isCompressed = params.isCompressed || false;
   }
   NodeCMapReaderFactory.prototype = {
-    fetch: function (params) {
+    fetch: function fetch(params) {
       var name = params.name;
       if (!name) {
         return Promise.reject(new Error('CMap name must be specified.'));

+ 1 - 1
lib/test/unit/testreporter.js

@@ -14,7 +14,7 @@
  */
 'use strict';
 
-var TestReporter = function (browser, appPath) {
+var TestReporter = function TestReporter(browser, appPath) {
   function send(action, json, cb) {
     var r = new XMLHttpRequest();
     r.open('POST', action, true);

+ 3 - 3
lib/test/unit/ui_utils_spec.js

@@ -89,7 +89,7 @@ describe('ui_utils', function () {
     it('dispatch to detached', function () {
       var eventBus = new EventBus();
       var count = 0;
-      var listener = function () {
+      var listener = function listener() {
         count++;
       };
       eventBus.on('test', listener);
@@ -114,11 +114,11 @@ describe('ui_utils', function () {
     it('dispatch to detached during handling', function () {
       var eventBus = new EventBus();
       var count = 0;
-      var listener1 = function () {
+      var listener1 = function listener1() {
         eventBus.off('test', listener2);
         count++;
       };
-      var listener2 = function () {
+      var listener2 = function listener2() {
         eventBus.off('test', listener1);
         count++;
       };

+ 1 - 1
lib/web/annotation_layer_builder.js

@@ -77,7 +77,7 @@ var AnnotationLayerBuilder = function AnnotationLayerBuilderClosure() {
 }();
 function DefaultAnnotationLayerFactory() {}
 DefaultAnnotationLayerFactory.prototype = {
-  createAnnotationLayerBuilder: function (pageDiv, pdfPage, renderInteractiveForms) {
+  createAnnotationLayerBuilder: function createAnnotationLayerBuilder(pageDiv, pdfPage, renderInteractiveForms) {
     return new AnnotationLayerBuilder({
       pageDiv: pageDiv,
       pdfPage: pdfPage,

+ 8 - 8
lib/web/app.js

@@ -72,11 +72,11 @@ function configure(PDFJS) {
   PDFJS.cMapPacked = true;
 }
 var DefaultExternalServices = {
-  updateFindControlState: function (data) {},
-  initPassiveLoading: function (callbacks) {},
-  fallback: function (data, callback) {},
-  reportTelemetry: function (data) {},
-  createDownloadManager: function () {
+  updateFindControlState: function updateFindControlState(data) {},
+  initPassiveLoading: function initPassiveLoading(callbacks) {},
+  fallback: function fallback(data, callback) {},
+  reportTelemetry: function reportTelemetry(data) {},
+  createDownloadManager: function createDownloadManager() {
     throw new Error('Not implemented: createDownloadManager');
   },
   supportsIntegratedFind: false,
@@ -148,7 +148,7 @@ var PDFViewerApplication = {
       self.initialized = true;
     });
   },
-  _readPreferences: function () {
+  _readPreferences: function _readPreferences() {
     var self = this;
     return Promise.all([_preferences.Preferences.get('enableWebGL').then(function resolved(value) {
       _pdfjs.PDFJS.disableWebGL = !value;
@@ -201,7 +201,7 @@ var PDFViewerApplication = {
       self.viewerPrefs['enablePrintAutoRotate'] = value;
     })]).catch(function (reason) {});
   },
-  _initializeViewerComponents: function () {
+  _initializeViewerComponents: function _initializeViewerComponents() {
     var self = this;
     var appConfig = this.appConfig;
     return new Promise(function (resolve, reject) {
@@ -1550,7 +1550,7 @@ _ui_utils.localized.then(function webViewerLocalized() {
 var PDFPrintServiceFactory = {
   instance: {
     supportsPrinting: false,
-    createPrintService: function () {
+    createPrintService: function createPrintService() {
       throw new Error('Not implemented: createPrintService');
     }
   }

+ 37 - 37
lib/web/chromecom.js

@@ -118,7 +118,7 @@ function requestAccessToLocalFile(fileUrl) {
   var onCloseOverlay = null;
   if (top !== window) {
     window.addEventListener('focus', reloadIfRuntimeIsUnavailable);
-    onCloseOverlay = function () {
+    onCloseOverlay = function onCloseOverlay() {
       window.removeEventListener('focus', reloadIfRuntimeIsUnavailable);
       reloadIfRuntimeIsUnavailable();
       _overlay_manager.OverlayManager.close('chromeFileAccessOverlay');
@@ -131,58 +131,58 @@ function requestAccessToLocalFile(fileUrl) {
     var iconPath = chrome.runtime.getManifest().icons[48];
     document.getElementById('chrome-pdfjs-logo-bg').style.backgroundImage = 'url(' + chrome.runtime.getURL(iconPath) + ')';
     var i18nFileAccessLabel = {
-      "am": "\u1208\u134b\u12ed\u120d \u12e9\u12a0\u122d\u12a4\u120d\u12ce\u127d \u1218\u12f3\u1228\u123b \u134d\u1240\u12f5",
-      "ar": "\u200f\u0627\u0644\u0633\u0645\u0627\u062d \u0628\u0627\u0644\u062f\u062e\u0648\u0644 \u0625\u0644\u0649 \u0639\u0646\u0627\u0648\u064a\u0646 URL \u0644\u0644\u0645\u0644\u0641\u0627\u062a",
-      "bg": "\u0414\u0430 \u0441\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438 \u0434\u043e\u0441\u0442\u044a\u043f \u0434\u043e URL \u0430\u0434\u0440\u0435\u0441\u0438\u0442\u0435 \u043d\u0430 \u0444\u0430\u0439\u043b\u043e\u0432\u0435\u0442\u0435",
-      "bn": "\u09ab\u09be\u0987\u09b2 URL\u0997\u09c1\u09b2\u09bf\u09a4\u09c7 \u0985\u09cd\u09af\u09be\u0995\u09cd\u09b8\u09c7\u09b8 \u09ae\u099e\u09cd\u099c\u09c1\u09b0 \u0995\u09b0\u09c1\u09a8",
-      "ca": "Permet l'acc\u00e9s als URL de fitxer",
-      "cs": "Umo\u017enit p\u0159\u00edstup k adres\u00e1m URL soubor\u016f",
-      "da": "Tillad adgang til webadresser p\u00e5 filer",
+      "am": '\u1208\u134B\u12ED\u120D \u12E9\u12A0\u122D\u12A4\u120D\u12CE\u127D \u1218\u12F3\u1228\u123B \u134D\u1240\u12F5',
+      "ar": '\u200F\u0627\u0644\u0633\u0645\u0627\u062D \u0628\u0627\u0644\u062F\u062E\u0648\u0644 \u0625\u0644\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 URL \u0644\u0644\u0645\u0644\u0641\u0627\u062A',
+      "bg": '\u0414\u0430 \u0441\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0438 \u0434\u043E\u0441\u0442\u044A\u043F \u0434\u043E URL \u0430\u0434\u0440\u0435\u0441\u0438\u0442\u0435 \u043D\u0430 \u0444\u0430\u0439\u043B\u043E\u0432\u0435\u0442\u0435',
+      "bn": '\u09AB\u09BE\u0987\u09B2 URL\u0997\u09C1\u09B2\u09BF\u09A4\u09C7 \u0985\u09CD\u09AF\u09BE\u0995\u09CD\u09B8\u09C7\u09B8 \u09AE\u099E\u09CD\u099C\u09C1\u09B0 \u0995\u09B0\u09C1\u09A8',
+      "ca": 'Permet l\'acc\xE9s als URL de fitxer',
+      "cs": 'Umo\u017Enit p\u0159\xEDstup k adres\xE1m URL soubor\u016F',
+      "da": 'Tillad adgang til webadresser p\xE5 filer',
       "de": "Zugriff auf Datei-URLs zulassen",
-      "el": "\u039d\u03b1 \u03b5\u03c0\u03b9\u03c4\u03c1\u03ad\u03c0\u03b5\u03c4\u03b1\u03b9 \u03b7 \u03c0\u03c1\u03cc\u03c3\u03b2\u03b1\u03c3\u03b7 \u03c3\u03b5 \u03b4\u03b9\u03b5\u03c5\u03b8\u03cd\u03bd\u03c3\u03b5\u03b9\u03c2 URL \u03b1\u03c1\u03c7\u03b5\u03af\u03c9\u03bd",
+      "el": '\u039D\u03B1 \u03B5\u03C0\u03B9\u03C4\u03C1\u03AD\u03C0\u03B5\u03C4\u03B1\u03B9 \u03B7 \u03C0\u03C1\u03CC\u03C3\u03B2\u03B1\u03C3\u03B7 \u03C3\u03B5 \u03B4\u03B9\u03B5\u03C5\u03B8\u03CD\u03BD\u03C3\u03B5\u03B9\u03C2 URL \u03B1\u03C1\u03C7\u03B5\u03AF\u03C9\u03BD',
       "en-GB": "Allow access to file URLs",
       "es": "Permitir acceso a URL de archivo",
       "es-419": "Permitir el acceso a las URL del archivo",
-      "et": "Luba juurdep\u00e4\u00e4s failide URL-idele",
-      "fa": "\u200f\u0627\u062c\u0627\u0632\u0647\u0654 \u062f\u0633\u062a\u0631\u0633\u06cc \u0628\u0647 URL \u0647\u0627\u06cc \u0641\u0627\u06cc\u0644",
-      "fi": "Salli tiedostojen URL-osoitteiden k\u00e4ytt\u00f6",
+      "et": 'Luba juurdep\xE4\xE4s failide URL-idele',
+      "fa": '\u200F\u0627\u062C\u0627\u0632\u0647\u0654 \u062F\u0633\u062A\u0631\u0633\u06CC \u0628\u0647 URL \u0647\u0627\u06CC \u0641\u0627\u06CC\u0644',
+      "fi": 'Salli tiedostojen URL-osoitteiden k\xE4ytt\xF6',
       "fil": "Payagan ang access na mag-file ng mga URL",
-      "fr": "Autoriser l'acc\u00e8s aux URL de fichier",
-      "gu": "URL \u0aab\u0abe\u0a87\u0ab2 \u0a95\u0ab0\u0ab5\u0abe \u0a8d\u0a95\u0acd\u0ab8\u0ac7\u0ab8\u0aa8\u0ac0 \u0aae\u0a82\u0a9c\u0ac2\u0ab0\u0ac0 \u0a86\u0aaa\u0acb",
-      "hi": "\u092b\u093c\u093e\u0907\u0932 URL \u0924\u0915 \u092a\u0939\u0941\u0902\u091a\u0928\u0947 \u0915\u0940 \u0905\u0928\u0941\u092e\u0924\u093f \u0926\u0947\u0902",
+      "fr": 'Autoriser l\'acc\xE8s aux URL de fichier',
+      "gu": 'URL \u0AAB\u0ABE\u0A87\u0AB2 \u0A95\u0AB0\u0AB5\u0ABE \u0A8D\u0A95\u0ACD\u0AB8\u0AC7\u0AB8\u0AA8\u0AC0 \u0AAE\u0A82\u0A9C\u0AC2\u0AB0\u0AC0 \u0A86\u0AAA\u0ACB',
+      "hi": '\u092B\u093C\u093E\u0907\u0932 URL \u0924\u0915 \u092A\u0939\u0941\u0902\u091A\u0928\u0947 \u0915\u0940 \u0905\u0928\u0941\u092E\u0924\u093F \u0926\u0947\u0902',
       "hr": "Dozvoli pristup URL-ovima datoteke",
-      "hu": "F\u00e1jl URL-ekhez val\u00f3 hozz\u00e1f\u00e9r\u00e9s enged\u00e9lyez\u00e9se",
+      "hu": 'F\xE1jl URL-ekhez val\xF3 hozz\xE1f\xE9r\xE9s enged\xE9lyez\xE9se',
       "id": "Izinkan akses ke URL file",
       "it": "Consenti l'accesso agli URL dei file",
-      "iw": "\u05d0\u05e4\u05e9\u05e8 \u05d2\u05d9\u05e9\u05d4 \u05dc\u05db\u05ea\u05d5\u05d1\u05d5\u05ea \u05d0\u05ea\u05e8\u05d9\u05dd \u05e9\u05dc \u05e7\u05d1\u05e6\u05d9\u05dd",
-      "ja": "\u30d5\u30a1\u30a4\u30eb\u306e URL \u3078\u306e\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u3059\u308b",
-      "kn": "URL \u0c97\u0cb3\u0ca8\u0ccd\u0ca8\u0cc1 \u0cab\u0cc8\u0cb2\u0ccd\u200c\u0c97\u0cb3\u0cbf\u0c97\u0cc6 \u0caa\u0ccd\u0cb0\u0cb5\u0cc7\u0cb6\u0cbf\u0cb8\u0cb2\u0cc1 \u0c85\u0ca8\u0cc1\u0cae\u0ca4\u0cbf\u0cb8\u0cbf",
-      "ko": "\ud30c\uc77c URL\uc5d0 \ub300\ud55c \uc561\uc138\uc2a4 \ud5c8\uc6a9",
+      "iw": '\u05D0\u05E4\u05E9\u05E8 \u05D2\u05D9\u05E9\u05D4 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05D0\u05EA\u05E8\u05D9\u05DD \u05E9\u05DC \u05E7\u05D1\u05E6\u05D9\u05DD',
+      "ja": '\u30D5\u30A1\u30A4\u30EB\u306E URL \u3078\u306E\u30A2\u30AF\u30BB\u30B9\u3092\u8A31\u53EF\u3059\u308B',
+      "kn": 'URL \u0C97\u0CB3\u0CA8\u0CCD\u0CA8\u0CC1 \u0CAB\u0CC8\u0CB2\u0CCD\u200C\u0C97\u0CB3\u0CBF\u0C97\u0CC6 \u0CAA\u0CCD\u0CB0\u0CB5\u0CC7\u0CB6\u0CBF\u0CB8\u0CB2\u0CC1 \u0C85\u0CA8\u0CC1\u0CAE\u0CA4\u0CBF\u0CB8\u0CBF',
+      "ko": '\uD30C\uC77C URL\uC5D0 \uB300\uD55C \uC561\uC138\uC2A4 \uD5C8\uC6A9',
       "lt": "Leisti pasiekti failo URL",
-      "lv": "At\u013caut piek\u013cuvi faila vietr\u0101\u017eiem URL",
-      "ml": "URL \u0d15\u0d33\u0d4d\u200d\u200c \u0d2b\u0d2f\u0d32\u0d4d\u200d\u200c \u0d1a\u0d46\u0d2f\u0d4d\u0d2f\u0d41\u0d28\u0d4d\u0d28\u0d24\u0d3f\u0d28\u0d4d \u0d06\u0d15\u0d4d\u200d\u0d38\u0d38\u0d4d\u0d38\u0d4d \u0d05\u0d28\u0d41\u0d35\u0d26\u0d3f\u0d15\u0d4d\u0d15\u0d41\u0d15",
-      "mr": "\u092b\u093e\u0907\u0932 URL \u092e\u0927\u094d\u092f\u0947 \u092a\u094d\u0930\u0935\u0947\u0936\u093e\u0938 \u0905\u0928\u0941\u092e\u0924\u0940 \u0926\u094d\u092f\u093e",
+      "lv": 'At\u013Caut piek\u013Cuvi faila vietr\u0101\u017Eiem URL',
+      "ml": 'URL \u0D15\u0D33\u0D4D\u200D\u200C \u0D2B\u0D2F\u0D32\u0D4D\u200D\u200C \u0D1A\u0D46\u0D2F\u0D4D\u0D2F\u0D41\u0D28\u0D4D\u0D28\u0D24\u0D3F\u0D28\u0D4D \u0D06\u0D15\u0D4D\u200D\u0D38\u0D38\u0D4D\u0D38\u0D4D \u0D05\u0D28\u0D41\u0D35\u0D26\u0D3F\u0D15\u0D4D\u0D15\u0D41\u0D15',
+      "mr": '\u092B\u093E\u0907\u0932 URL \u092E\u0927\u094D\u092F\u0947 \u092A\u094D\u0930\u0935\u0947\u0936\u093E\u0938 \u0905\u0928\u0941\u092E\u0924\u0940 \u0926\u094D\u092F\u093E',
       "ms": "Membenarkan akses ke URL fail",
       "nl": "Toegang tot bestand-URL's toestaan",
       "no": "Tillat tilgang til filnettadresser",
-      "pl": "Zezwalaj na dost\u0119p do adres\u00f3w URL plik\u00f3w",
+      "pl": 'Zezwalaj na dost\u0119p do adres\xF3w URL plik\xF3w',
       "pt-BR": "Permitir acesso aos URLs do arquivo",
       "pt-PT": "Permitir acesso a URLs de ficheiro",
-      "ro": "Permite accesul la adresele URL de fi\u0219iere",
-      "ru": "\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0430\u043c",
-      "sk": "Povoli\u0165 pr\u00edstup k webov\u00fdm adres\u00e1m s\u00faboru",
+      "ro": 'Permite accesul la adresele URL de fi\u0219iere',
+      "ru": '\u0420\u0430\u0437\u0440\u0435\u0448\u0438\u0442\u044C \u043E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0444\u0430\u0439\u043B\u044B \u043F\u043E \u0441\u0441\u044B\u043B\u043A\u0430\u043C',
+      "sk": 'Povoli\u0165 pr\xEDstup k webov\xFDm adres\xE1m s\xFAboru',
       "sl": "Dovoli dostop do URL-jev datoteke",
-      "sr": "\u0414\u043e\u0437\u0432\u043e\u043b\u0438 \u043f\u0440\u0438\u0441\u0442\u0443\u043f URL \u0430\u0434\u0440\u0435\u0441\u0430\u043c\u0430 \u0434\u0430\u0442\u043e\u0442\u0435\u043a\u0430",
-      "sv": "Till\u00e5t \u00e5tkomst till webbadresser i filen",
+      "sr": '\u0414\u043E\u0437\u0432\u043E\u043B\u0438 \u043F\u0440\u0438\u0441\u0442\u0443\u043F URL \u0430\u0434\u0440\u0435\u0441\u0430\u043C\u0430 \u0434\u0430\u0442\u043E\u0442\u0435\u043A\u0430',
+      "sv": 'Till\xE5t \xE5tkomst till webbadresser i filen',
       "sw": "Ruhusu kufikia URL za faili",
-      "ta": "\u0b95\u0bcb\u0baa\u0bcd\u0baa\u0bc1  URL\u0b95\u0bb3\u0bc1\u0b95\u0bcd\u0b95\u0bc1 \u0b85\u0ba3\u0bc1\u0b95\u0bb2\u0bc8 \u0b85\u0ba9\u0bc1\u0bae\u0ba4\u0bbf",
-      "te": "\u0c2b\u0c48\u0c32\u0c4d URL\u0c32\u0c15\u0c41 \u0c2a\u0c4d\u0c30\u0c3e\u0c2a\u0c4d\u0c24\u0c3f\u0c28\u0c3f \u0c05\u0c28\u0c41\u0c2e\u0c24\u0c3f\u0c02\u0c1a\u0c41",
-      "th": "\u0e2d\u0e19\u0e38\u0e0d\u0e32\u0e15\u0e43\u0e2b\u0e49\u0e40\u0e02\u0e49\u0e32\u0e16\u0e36\u0e07\u0e44\u0e1f\u0e25\u0e4c URL",
-      "tr": "Dosya URL'lerine eri\u015fime izin ver",
-      "uk": "\u041d\u0430\u0434\u0430\u0432\u0430\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f \u0434\u043e URL-\u0430\u0434\u0440\u0435\u0441 \u0444\u0430\u0439\u043b\u0443",
-      "vi": "Cho ph\u00e9p truy c\u1eadp v\u00e0o c\u00e1c URL c\u1ee7a t\u1ec7p",
-      "zh-CN": "\u5141\u8bb8\u8bbf\u95ee\u6587\u4ef6\u7f51\u5740",
-      "zh-TW": "\u5141\u8a31\u5b58\u53d6\u6a94\u6848\u7db2\u5740"
+      "ta": '\u0B95\u0BCB\u0BAA\u0BCD\u0BAA\u0BC1  URL\u0B95\u0BB3\u0BC1\u0B95\u0BCD\u0B95\u0BC1 \u0B85\u0BA3\u0BC1\u0B95\u0BB2\u0BC8 \u0B85\u0BA9\u0BC1\u0BAE\u0BA4\u0BBF',
+      "te": '\u0C2B\u0C48\u0C32\u0C4D URL\u0C32\u0C15\u0C41 \u0C2A\u0C4D\u0C30\u0C3E\u0C2A\u0C4D\u0C24\u0C3F\u0C28\u0C3F \u0C05\u0C28\u0C41\u0C2E\u0C24\u0C3F\u0C02\u0C1A\u0C41',
+      "th": '\u0E2D\u0E19\u0E38\u0E0D\u0E32\u0E15\u0E43\u0E2B\u0E49\u0E40\u0E02\u0E49\u0E32\u0E16\u0E36\u0E07\u0E44\u0E1F\u0E25\u0E4C URL',
+      "tr": 'Dosya URL\'lerine eri\u015Fime izin ver',
+      "uk": '\u041D\u0430\u0434\u0430\u0432\u0430\u0442\u0438 \u0434\u043E\u0441\u0442\u0443\u043F \u0434\u043E URL-\u0430\u0434\u0440\u0435\u0441 \u0444\u0430\u0439\u043B\u0443',
+      "vi": 'Cho ph\xE9p truy c\u1EADp v\xE0o c\xE1c URL c\u1EE7a t\u1EC7p',
+      "zh-CN": '\u5141\u8BB8\u8BBF\u95EE\u6587\u4EF6\u7F51\u5740',
+      "zh-TW": '\u5141\u8A31\u5B58\u53D6\u6A94\u6848\u7DB2\u5740'
     }[chrome.i18n.getUILanguage && chrome.i18n.getUILanguage()];
     if (i18nFileAccessLabel) {
       document.getElementById('chrome-file-access-label').textContent = i18nFileAccessLabel;

+ 8 - 6
lib/web/debugger.js

@@ -14,6 +14,8 @@
  */
 'use strict';
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var FontInspector = function FontInspectorClosure() {
   var fonts;
   var active = false;
@@ -243,7 +245,7 @@ var Stepper = function StepperClosure() {
       var MAX_STRING_LENGTH = 75;
       return args.length <= MAX_STRING_LENGTH ? args : args.substr(0, MAX_STRING_LENGTH) + '...';
     }
-    if (typeof args !== 'object' || args === null) {
+    if ((typeof args === 'undefined' ? 'undefined' : _typeof(args)) !== 'object' || args === null) {
       return args;
     }
     if ('length' in args) {
@@ -333,7 +335,7 @@ var Stepper = function StepperClosure() {
           var str = [];
           for (var j = 0; j < glyphs.length; j++) {
             var glyph = glyphs[j];
-            if (typeof glyph === 'object' && glyph !== null) {
+            if ((typeof glyph === 'undefined' ? 'undefined' : _typeof(glyph)) === 'object' && glyph !== null) {
               str.push(glyph.fontChar);
             } else {
               if (str.length > 0) {
@@ -376,7 +378,7 @@ var Stepper = function StepperClosure() {
       var self = this;
       var dom = document;
       self.currentIdx = idx;
-      var listener = function (e) {
+      var listener = function listener(e) {
         switch (e.keyCode) {
           case 83:
             dom.removeEventListener('keydown', listener);
@@ -437,7 +439,7 @@ var Stats = function Stats() {
     },
     enabled: false,
     active: false,
-    add: function (pageNumber, stat) {
+    add: function add(pageNumber, stat) {
       if (!stat) {
         return;
       }
@@ -468,7 +470,7 @@ var Stats = function Stats() {
         this.panel.appendChild(stats[i].div);
       }
     },
-    cleanup: function () {
+    cleanup: function cleanup() {
       stats = [];
       clear(this.panel);
     }
@@ -480,7 +482,7 @@ window.PDFBug = function PDFBugClosure() {
   var activePanel = null;
   return {
     tools: [FontInspector, StepperManager, Stats],
-    enable: function (ids) {
+    enable: function enable(ids) {
       var all = false,
           tools = this.tools;
       if (ids.length === 1 && ids[0] === 'all') {

+ 3 - 3
lib/web/firefox_print_service.js

@@ -68,7 +68,7 @@ function FirefoxPrintService(pdfDocument, pagesOverview, printContainer) {
   this.printContainer = printContainer;
 }
 FirefoxPrintService.prototype = {
-  layout: function () {
+  layout: function layout() {
     var pdfDocument = this.pdfDocument;
     var printContainer = this.printContainer;
     var body = document.querySelector('body');
@@ -77,7 +77,7 @@ FirefoxPrintService.prototype = {
       composePage(pdfDocument, i + 1, this.pagesOverview[i], printContainer);
     }
   },
-  destroy: function () {
+  destroy: function destroy() {
     this.printContainer.textContent = '';
   }
 };
@@ -87,7 +87,7 @@ _app.PDFPrintServiceFactory.instance = {
     var value = 'mozPrintCallback' in canvas;
     return (0, _pdfjs.shadow)(this, 'supportsPrinting', value);
   },
-  createPrintService: function (pdfDocument, pagesOverview, printContainer) {
+  createPrintService: function createPrintService(pdfDocument, pagesOverview, printContainer) {
     return new FirefoxPrintService(pdfDocument, pagesOverview, printContainer);
   }
 };

+ 13 - 11
lib/web/firefoxcom.js

@@ -19,6 +19,8 @@ Object.defineProperty(exports, "__esModule", {
 });
 exports.FirefoxCom = exports.DownloadManager = undefined;
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var _pdfjs = require('./pdfjs');
 
 var _app = require('./app');
@@ -30,7 +32,7 @@ var _preferences = require('./preferences');
 }
 var FirefoxCom = function FirefoxComClosure() {
   return {
-    requestSync: function (action, data) {
+    requestSync: function requestSync(action, data) {
       var request = document.createTextNode('');
       document.documentElement.appendChild(request);
       var sender = document.createEvent('CustomEvent');
@@ -44,7 +46,7 @@ var FirefoxCom = function FirefoxComClosure() {
       document.documentElement.removeChild(request);
       return response;
     },
-    request: function (action, data, callback) {
+    request: function request(action, data, callback) {
       var request = document.createTextNode('');
       if (callback) {
         document.addEventListener('pdf.js.response', function listener(event) {
@@ -116,7 +118,7 @@ _preferences.Preferences._readFromStorage = function (prefObj) {
 };
 (function listenFindEvents() {
   var events = ['find', 'findagain', 'findhighlightallchange', 'findcasesensitivitychange'];
-  var handleEvent = function (evt) {
+  var handleEvent = function handleEvent(evt) {
     if (!_app.PDFViewerApplication.initialized) {
       return;
     }
@@ -148,10 +150,10 @@ FirefoxComDataRangeTransport.prototype.abort = function FirefoxComDataRangeTrans
   FirefoxCom.requestSync('abortLoading', null);
 };
 _app.PDFViewerApplication.externalServices = {
-  updateFindControlState: function (data) {
+  updateFindControlState: function updateFindControlState(data) {
     FirefoxCom.request('updateFindControlState', data);
   },
-  initPassiveLoading: function (callbacks) {
+  initPassiveLoading: function initPassiveLoading(callbacks) {
     var pdfDataRangeTransport;
     window.addEventListener('message', function windowMessage(e) {
       if (e.source !== null) {
@@ -159,7 +161,7 @@ _app.PDFViewerApplication.externalServices = {
         return;
       }
       var args = e.data;
-      if (typeof args !== 'object' || !('pdfjsLoadAction' in args)) {
+      if ((typeof args === 'undefined' ? 'undefined' : _typeof(args)) !== 'object' || !('pdfjsLoadAction' in args)) {
         return;
       }
       switch (args.pdfjsLoadAction) {
@@ -190,13 +192,13 @@ _app.PDFViewerApplication.externalServices = {
     });
     FirefoxCom.requestSync('initPassiveLoading', null);
   },
-  fallback: function (data, callback) {
+  fallback: function fallback(data, callback) {
     FirefoxCom.request('fallback', data, callback);
   },
-  reportTelemetry: function (data) {
+  reportTelemetry: function reportTelemetry(data) {
     FirefoxCom.request('reportTelemetry', JSON.stringify(data));
   },
-  createDownloadManager: function () {
+  createDownloadManager: function createDownloadManager() {
     return new DownloadManager();
   },
   get supportsIntegratedFind() {
@@ -217,10 +219,10 @@ _app.PDFViewerApplication.externalServices = {
   }
 };
 document.mozL10n.setExternalLocalizerServices({
-  getLocale: function () {
+  getLocale: function getLocale() {
     return FirefoxCom.requestSync('getLocale', null);
   },
-  getStrings: function (key) {
+  getStrings: function getStrings(key) {
     return FirefoxCom.requestSync('getStrings', key);
   }
 });

+ 14 - 14
lib/web/interfaces.js

@@ -18,32 +18,32 @@ function IPDFLinkService() {}
 IPDFLinkService.prototype = {
   get page() {},
   set page(value) {},
-  navigateTo: function (dest) {},
-  getDestinationHash: function (dest) {},
-  getAnchorUrl: function (hash) {},
-  setHash: function (hash) {},
-  executeNamedAction: function (action) {},
-  cachePageRef: function (pageNum, pageRef) {}
+  navigateTo: function navigateTo(dest) {},
+  getDestinationHash: function getDestinationHash(dest) {},
+  getAnchorUrl: function getAnchorUrl(hash) {},
+  setHash: function setHash(hash) {},
+  executeNamedAction: function executeNamedAction(action) {},
+  cachePageRef: function cachePageRef(pageNum, pageRef) {}
 };
 function IPDFHistory() {}
 IPDFHistory.prototype = {
-  forward: function () {},
-  back: function () {},
-  push: function (params) {},
-  updateNextHashParam: function (hash) {}
+  forward: function forward() {},
+  back: function back() {},
+  push: function push(params) {},
+  updateNextHashParam: function updateNextHashParam(hash) {}
 };
 function IRenderableView() {}
 IRenderableView.prototype = {
   get renderingId() {},
   get renderingState() {},
-  draw: function () {},
-  resume: function () {}
+  draw: function draw() {},
+  resume: function resume() {}
 };
 function IPDFTextLayerFactory() {}
 IPDFTextLayerFactory.prototype = {
-  createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport, enhanceTextSelection) {}
+  createTextLayerBuilder: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection) {}
 };
 function IPDFAnnotationLayerFactory() {}
 IPDFAnnotationLayerFactory.prototype = {
-  createAnnotationLayerBuilder: function (pageDiv, pdfPage, renderInteractiveForms) {}
+  createAnnotationLayerBuilder: function createAnnotationLayerBuilder(pageDiv, pdfPage, renderInteractiveForms) {}
 };

+ 1 - 1
lib/web/pdf_find_bar.js

@@ -121,7 +121,7 @@ var PDFFindBar = function PDFFindBarClosure() {
       this.updateResultsCount(matchCount);
       this._adjustWidth();
     },
-    updateResultsCount: function (matchCount) {
+    updateResultsCount: function updateResultsCount(matchCount) {
       if (!this.findResultsCount) {
         return;
       }

+ 3 - 3
lib/web/pdf_find_controller.js

@@ -38,9 +38,9 @@ var CHARACTERS_TO_NORMALIZE = {
   '\u201D': '"',
   '\u201E': '"',
   '\u201F': '"',
-  '\u00BC': '1/4',
-  '\u00BD': '1/2',
-  '\u00BE': '3/4'
+  '\xBC': '1/4',
+  '\xBD': '1/2',
+  '\xBE': '3/4'
 };
 var PDFFindController = function PDFFindControllerClosure() {
   function PDFFindController(options) {

+ 13 - 11
lib/web/pdf_link_service.js

@@ -19,6 +19,8 @@ Object.defineProperty(exports, "__esModule", {
 });
 exports.SimpleLinkService = exports.PDFLinkService = undefined;
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var _dom_events = require('./dom_events');
 
 var _ui_utils = require('./ui_utils');
@@ -61,7 +63,7 @@ var PDFLinkService = function PDFLinkServiceClosure() {
     navigateTo: function PDFLinkService_navigateTo(dest) {
       var destString = '';
       var self = this;
-      var goToDestination = function (destRef) {
+      var goToDestination = function goToDestination(destRef) {
         var pageNumber;
         if (destRef instanceof Object) {
           pageNumber = self._cachedPageNumber(destRef);
@@ -241,7 +243,7 @@ var PDFLinkService = function PDFLinkServiceClosure() {
         action: action
       });
     },
-    onFileAttachmentAnnotation: function (params) {
+    onFileAttachmentAnnotation: function onFileAttachmentAnnotation(params) {
       this.eventBus.dispatch('fileattachmentannotation', {
         source: this,
         id: params.id,
@@ -268,11 +270,11 @@ var PDFLinkService = function PDFLinkServiceClosure() {
       return false;
     }
     var page = dest[0];
-    if (!(typeof page === 'object' && typeof page.num === 'number' && (page.num | 0) === page.num && typeof page.gen === 'number' && (page.gen | 0) === page.gen) && !(typeof page === 'number' && (page | 0) === page && page >= 0)) {
+    if (!((typeof page === 'undefined' ? 'undefined' : _typeof(page)) === 'object' && typeof page.num === 'number' && (page.num | 0) === page.num && typeof page.gen === 'number' && (page.gen | 0) === page.gen) && !(typeof page === 'number' && (page | 0) === page && page >= 0)) {
       return false;
     }
     var zoom = dest[1];
-    if (!(typeof zoom === 'object' && typeof zoom.name === 'string')) {
+    if (!((typeof zoom === 'undefined' ? 'undefined' : _typeof(zoom)) === 'object' && typeof zoom.name === 'string')) {
       return false;
     }
     switch (zoom.name) {
@@ -318,17 +320,17 @@ var SimpleLinkService = function SimpleLinkServiceClosure() {
       return 0;
     },
     set page(value) {},
-    navigateTo: function (dest) {},
-    getDestinationHash: function (dest) {
+    navigateTo: function navigateTo(dest) {},
+    getDestinationHash: function getDestinationHash(dest) {
       return '#';
     },
-    getAnchorUrl: function (hash) {
+    getAnchorUrl: function getAnchorUrl(hash) {
       return '#';
     },
-    setHash: function (hash) {},
-    executeNamedAction: function (action) {},
-    onFileAttachmentAnnotation: function (params) {},
-    cachePageRef: function (pageNum, pageRef) {}
+    setHash: function setHash(hash) {},
+    executeNamedAction: function executeNamedAction(action) {},
+    onFileAttachmentAnnotation: function onFileAttachmentAnnotation(params) {},
+    cachePageRef: function cachePageRef(pageNum, pageRef) {}
   };
   return SimpleLinkService;
 }();

+ 8 - 8
lib/web/pdf_page_view.js

@@ -87,7 +87,7 @@ var PDFPageView = function PDFPageViewClosure() {
         this.pdfPage.cleanup();
       }
     },
-    _resetZoomLayer: function (removeFromDOM) {
+    _resetZoomLayer: function _resetZoomLayer(removeFromDOM) {
       if (!this.zoomLayer) {
         return;
       }
@@ -366,7 +366,7 @@ var PDFPageView = function PDFPageViewClosure() {
       }
       return resultPromise;
     },
-    paintOnCanvas: function (canvasWrapper) {
+    paintOnCanvas: function paintOnCanvas(canvasWrapper) {
       var resolveRenderPromise, rejectRenderPromise;
       var promise = new Promise(function (resolve, reject) {
         resolveRenderPromise = resolve;
@@ -374,10 +374,10 @@ var PDFPageView = function PDFPageViewClosure() {
       });
       var result = {
         promise: promise,
-        onRenderContinue: function (cont) {
+        onRenderContinue: function onRenderContinue(cont) {
           cont();
         },
-        cancel: function () {
+        cancel: function cancel() {
           renderTask.cancel();
         }
       };
@@ -386,7 +386,7 @@ var PDFPageView = function PDFPageViewClosure() {
       canvas.id = 'page' + this.id;
       canvas.setAttribute('hidden', 'hidden');
       var isCanvasHidden = true;
-      var showCanvas = function () {
+      var showCanvas = function showCanvas() {
         if (isCanvasHidden) {
           canvas.removeAttribute('hidden');
           isCanvasHidden = false;
@@ -450,7 +450,7 @@ var PDFPageView = function PDFPageViewClosure() {
     },
     paintOnSvg: function PDFPageView_paintOnSvg(wrapper) {
       var cancelled = false;
-      var ensureNotCancelled = function () {
+      var ensureNotCancelled = function ensureNotCancelled() {
         if (cancelled) {
           if (_pdfjs.PDFJS.pdfjsNext) {
             throw new _pdfjs.RenderingCancelledException('Rendering cancelled, page ' + self.id, 'svg');
@@ -477,10 +477,10 @@ var PDFPageView = function PDFPageViewClosure() {
       });
       return {
         promise: promise,
-        onRenderContinue: function (cont) {
+        onRenderContinue: function onRenderContinue(cont) {
           cont();
         },
-        cancel: function () {
+        cancel: function cancel() {
           cancelled = true;
         }
       };

+ 8 - 8
lib/web/pdf_print_service.js

@@ -64,7 +64,7 @@ function PDFPrintService(pdfDocument, pagesOverview, printContainer) {
   this.scratchCanvas = document.createElement('canvas');
 }
 PDFPrintService.prototype = {
-  layout: function () {
+  layout: function layout() {
     this.throwIfInactive();
     var body = document.querySelector('body');
     body.setAttribute('data-pdfjsprinting', true);
@@ -79,7 +79,7 @@ PDFPrintService.prototype = {
     this.pageStyleSheet.textContent = '@supports ((size:A4) and (size:1pt 1pt)) {' + '@page { size: ' + pageSize.width + 'pt ' + pageSize.height + 'pt;}' + '}';
     body.appendChild(this.pageStyleSheet);
   },
-  destroy: function () {
+  destroy: function destroy() {
     if (activeService !== this) {
       return;
     }
@@ -98,7 +98,7 @@ PDFPrintService.prototype = {
       _overlay_manager.OverlayManager.close('printServiceOverlay');
     });
   },
-  renderPages: function () {
+  renderPages: function renderPages() {
     var pageCount = this.pagesOverview.length;
     var renderNextPage = function (resolve, reject) {
       this.throwIfInactive();
@@ -115,7 +115,7 @@ PDFPrintService.prototype = {
     }.bind(this);
     return new Promise(renderNextPage);
   },
-  useRenderedPage: function (printItem) {
+  useRenderedPage: function useRenderedPage(printItem) {
     this.throwIfInactive();
     var img = document.createElement('img');
     img.style.width = printItem.width;
@@ -136,7 +136,7 @@ PDFPrintService.prototype = {
       img.onerror = reject;
     });
   },
-  performPrint: function () {
+  performPrint: function performPrint() {
     this.throwIfInactive();
     return new Promise(function (resolve) {
       setTimeout(function () {
@@ -152,7 +152,7 @@ PDFPrintService.prototype = {
   get active() {
     return this === activeService;
   },
-  throwIfInactive: function () {
+  throwIfInactive: function throwIfInactive() {
     if (!this.active) {
       throw new Error('This print request was cancelled or completed.');
     }
@@ -234,7 +234,7 @@ if (hasAttachEvent) {
   });
 }
 if ('onbeforeprint' in window) {
-  var stopPropagationIfNeeded = function (event) {
+  var stopPropagationIfNeeded = function stopPropagationIfNeeded(event) {
     if (event.detail !== 'custom' && event.stopImmediatePropagation) {
       event.stopImmediatePropagation();
     }
@@ -252,7 +252,7 @@ function ensureOverlay() {
 }
 _app.PDFPrintServiceFactory.instance = {
   supportsPrinting: true,
-  createPrintService: function (pdfDocument, pagesOverview, printContainer) {
+  createPrintService: function createPrintService(pdfDocument, pagesOverview, printContainer) {
     if (activeService) {
       throw new Error('The print service is created and active.');
     }

+ 2 - 2
lib/web/pdf_sidebar.js

@@ -206,7 +206,7 @@ var PDFSidebar = function PDFSidebarClosure() {
       }
       thumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber);
     },
-    _showUINotification: function (view) {
+    _showUINotification: function _showUINotification(view) {
       if (this.disableNotification) {
         return;
       }
@@ -225,7 +225,7 @@ var PDFSidebar = function PDFSidebarClosure() {
           break;
       }
     },
-    _hideUINotification: function (view) {
+    _hideUINotification: function _hideUINotification(view) {
       if (this.disableNotification) {
         return;
       }

+ 1 - 1
lib/web/pdf_thumbnail_viewer.js

@@ -152,7 +152,7 @@ var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
       this._pagesRequests[pageNumber] = promise;
       return promise;
     },
-    forceRendering: function () {
+    forceRendering: function forceRendering() {
       var visibleThumbs = this._getVisibleThumbs();
       var thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this.thumbnails, this.scroll.down);
       if (thumbView) {

+ 17 - 17
lib/web/pdf_viewer.js

@@ -103,7 +103,7 @@ var PDFViewer = function pdfViewer() {
     get pagesCount() {
       return this._pages.length;
     },
-    getPageView: function (index) {
+    getPageView: function getPageView(index) {
       return this._pages[index];
     },
     get pageViewsReady() {
@@ -203,7 +203,7 @@ var PDFViewer = function pdfViewer() {
         this.update();
       }
     },
-    setDocument: function (pdfDocument) {
+    setDocument: function setDocument(pdfDocument) {
       if (this.pdfDocument) {
         this._cancelRendering();
         this._resetView();
@@ -232,7 +232,7 @@ var PDFViewer = function pdfViewer() {
         resolveOnePageRendered = resolve;
       });
       this.onePageRendered = onePageRendered;
-      var bindOnAfterAndBeforeDraw = function (pageView) {
+      var bindOnAfterAndBeforeDraw = function bindOnAfterAndBeforeDraw(pageView) {
         pageView.onBeforeDraw = function pdfViewLoadOnBeforeDraw() {
           self._buffer.push(this);
         };
@@ -317,7 +317,7 @@ var PDFViewer = function pdfViewer() {
         pageView.setPageLabel(label);
       }
     },
-    _resetView: function () {
+    _resetView: function _resetView() {
       this._pages = [];
       this._currentPageNumber = 1;
       this._currentScale = _ui_utils.UNKNOWN_SCALE;
@@ -416,7 +416,7 @@ var PDFViewer = function pdfViewer() {
         this._setScaleUpdatePages(scale, value, noScroll, true);
       }
     },
-    _resetCurrentPageView: function () {
+    _resetCurrentPageView: function _resetCurrentPageView() {
       if (this.isInPresentationMode) {
         this._setScale(this._currentScaleValue, true);
       }
@@ -524,7 +524,7 @@ var PDFViewer = function pdfViewer() {
         top: top
       });
     },
-    _updateLocation: function (firstPage) {
+    _updateLocation: function _updateLocation(firstPage) {
       var currentScale = this._currentScale;
       var currentScaleValue = this._currentScaleValue;
       var normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;
@@ -578,10 +578,10 @@ var PDFViewer = function pdfViewer() {
         location: this._location
       });
     },
-    containsElement: function (element) {
+    containsElement: function containsElement(element) {
       return this.container.contains(element);
     },
-    focus: function () {
+    focus: function focus() {
       this.container.focus();
     },
     get isInPresentationMode() {
@@ -593,7 +593,7 @@ var PDFViewer = function pdfViewer() {
     get isHorizontalScrollbarEnabled() {
       return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;
     },
-    _getVisiblePages: function () {
+    _getVisiblePages: function _getVisiblePages() {
       if (!this.isInPresentationMode) {
         return (0, _ui_utils.getVisibleElements)(this.container, this._pages, true);
       }
@@ -609,7 +609,7 @@ var PDFViewer = function pdfViewer() {
         views: visible
       };
     },
-    cleanup: function () {
+    cleanup: function cleanup() {
       for (var i = 0, ii = this._pages.length; i < ii; i++) {
         if (this._pages[i] && this._pages[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {
           this._pages[i].reset();
@@ -623,7 +623,7 @@ var PDFViewer = function pdfViewer() {
         }
       }
     },
-    _ensurePdfPageLoaded: function (pageView) {
+    _ensurePdfPageLoaded: function _ensurePdfPageLoaded(pageView) {
       if (pageView.pdfPage) {
         return Promise.resolve(pageView.pdfPage);
       }
@@ -639,7 +639,7 @@ var PDFViewer = function pdfViewer() {
       this._pagesRequests[pageNumber] = promise;
       return promise;
     },
-    forceRendering: function (currentlyVisiblePages) {
+    forceRendering: function forceRendering(currentlyVisiblePages) {
       var visiblePages = currentlyVisiblePages || this._getVisiblePages();
       var pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, this.scroll.down);
       if (pageView) {
@@ -650,12 +650,12 @@ var PDFViewer = function pdfViewer() {
       }
       return false;
     },
-    getPageTextContent: function (pageIndex) {
+    getPageTextContent: function getPageTextContent(pageIndex) {
       return this.pdfDocument.getPage(pageIndex + 1).then(function (page) {
         return page.getTextContent({ normalizeWhitespace: true });
       });
     },
-    createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
+    createTextLayerBuilder: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
       return new _text_layer_builder.TextLayerBuilder({
         textLayerDiv: textLayerDiv,
         eventBus: this.eventBus,
@@ -665,7 +665,7 @@ var PDFViewer = function pdfViewer() {
         enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection
       });
     },
-    createAnnotationLayerBuilder: function (pageDiv, pdfPage, renderInteractiveForms) {
+    createAnnotationLayerBuilder: function createAnnotationLayerBuilder(pageDiv, pdfPage, renderInteractiveForms) {
       return new _annotation_layer_builder.AnnotationLayerBuilder({
         pageDiv: pageDiv,
         pdfPage: pdfPage,
@@ -674,10 +674,10 @@ var PDFViewer = function pdfViewer() {
         downloadManager: this.downloadManager
       });
     },
-    setFindController: function (findController) {
+    setFindController: function setFindController(findController) {
       this.findController = findController;
     },
-    getPagesOverview: function () {
+    getPagesOverview: function getPagesOverview() {
       var pagesOverview = this._pages.map(function (pageView) {
         var viewport = pageView.pdfPage.getViewport(1);
         return {

+ 5 - 2
lib/web/preferences.js

@@ -17,6 +17,9 @@
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var defaultPreferences = null;
 function getDefaultPreferences() {
   if (!defaultPreferences) {
@@ -101,8 +104,8 @@ var Preferences = {
       } else if (value === undefined) {
         throw new Error('preferencesSet: no value is specified.');
       }
-      var valueType = typeof value;
-      var defaultType = typeof this.defaults[name];
+      var valueType = typeof value === "undefined" ? "undefined" : _typeof(value);
+      var defaultType = _typeof(this.defaults[name]);
       if (valueType !== defaultType) {
         if (valueType === 'number' && defaultType === 'string') {
           value = value.toString();

+ 1 - 1
lib/web/text_layer_builder.js

@@ -278,7 +278,7 @@ var TextLayerBuilder = function TextLayerBuilderClosure() {
 }();
 function DefaultTextLayerFactory() {}
 DefaultTextLayerFactory.prototype = {
-  createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
+  createTextLayerBuilder: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
     return new TextLayerBuilder({
       textLayerDiv: textLayerDiv,
       pageIndex: pageIndex,

+ 4 - 4
lib/web/toolbar.js

@@ -35,22 +35,22 @@ var Toolbar = function ToolbarClosure() {
     this._bindListeners();
   }
   Toolbar.prototype = {
-    setPageNumber: function (pageNumber, pageLabel) {
+    setPageNumber: function setPageNumber(pageNumber, pageLabel) {
       this.pageNumber = pageNumber;
       this.pageLabel = pageLabel;
       this._updateUIState(false);
     },
-    setPagesCount: function (pagesCount, hasPageLabels) {
+    setPagesCount: function setPagesCount(pagesCount, hasPageLabels) {
       this.pagesCount = pagesCount;
       this.hasPageLabels = hasPageLabels;
       this._updateUIState(true);
     },
-    setPageScale: function (pageScaleValue, pageScale) {
+    setPageScale: function setPageScale(pageScaleValue, pageScale) {
       this.pageScaleValue = pageScaleValue;
       this.pageScale = pageScale;
       this._updateUIState(false);
     },
-    reset: function () {
+    reset: function reset() {
       this.pageNumber = 0;
       this.pageLabel = null;
       this.hasPageLabels = false;

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.8.205",
+  "version": "1.8.207",
   "main": "build/pdf.js",
   "description": "Generic build of Mozilla's PDF.js library.",
   "keywords": [

+ 31 - 27
web/compatibility.js

@@ -98,6 +98,8 @@ return /******/ (function(modules) { // webpackBootstrap
 "use strict";
 /* WEBPACK VAR INJECTION */(function(global) {
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
   var globalScope = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : undefined;
   var userAgent = typeof navigator !== 'undefined' && navigator.userAgent || '';
@@ -111,7 +113,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
   var isIOS = /\b(iPad|iPhone|iPod)(?=;)/.test(userAgent);
   var isOpera = userAgent.indexOf('Opera') >= 0;
   var isSafari = /Safari\//.test(userAgent) && !/(Chrome\/|Android\s)/.test(userAgent);
-  var hasDOM = typeof window === 'object' && typeof document === 'object';
+  var hasDOM = (typeof window === 'undefined' ? 'undefined' : _typeof(window)) === 'object' && (typeof document === 'undefined' ? 'undefined' : _typeof(document)) === 'object';
   if (typeof PDFJS === 'undefined') {
     globalScope.PDFJS = {};
   }
@@ -152,12 +154,12 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
     var uint32ArrayViewSetters = 0;
     function createUint32ArrayProp(index) {
       return {
-        get: function () {
+        get: function get() {
           var buffer = this.buffer,
               offset = index << 2;
           return (buffer[offset] | buffer[offset + 1] << 8 | buffer[offset + 2] << 16 | buffer[offset + 3] << 24) >>> 0;
         },
-        set: function (value) {
+        set: function set(value) {
           var buffer = this.buffer,
               offset = index << 2;
           buffer[offset] = value & 255;
@@ -192,7 +194,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       result.buffer = result;
       result.byteLength = result.length;
       result.set = setArrayOffset;
-      if (typeof arg1 === 'object' && arg1.buffer) {
+      if ((typeof arg1 === 'undefined' ? 'undefined' : _typeof(arg1)) === 'object' && arg1.buffer) {
         result.buffer = arg1.buffer;
       }
       return result;
@@ -222,14 +224,14 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     Object.defineProperty(cpaProto, 'buffer', {
-      get: function () {
+      get: function get() {
         return this;
       },
       enumerable: false,
       configurable: true
     });
     Object.defineProperty(cpaProto, 'byteLength', {
-      get: function () {
+      get: function get() {
         return this.length;
       },
       enumerable: false,
@@ -398,7 +400,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     Object.defineProperty(HTMLElement.prototype, 'dataset', {
-      get: function () {
+      get: function get() {
         if (this._dataset) {
           return this._dataset;
         }
@@ -448,21 +450,21 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     var classListPrototype = {
-      add: function (name) {
+      add: function add(name) {
         changeList(this.element, name, true, false);
       },
-      contains: function (name) {
+      contains: function contains(name) {
         return changeList(this.element, name, false, false);
       },
-      remove: function (name) {
+      remove: function remove(name) {
         changeList(this.element, name, false, true);
       },
-      toggle: function (name) {
+      toggle: function toggle(name) {
         changeList(this.element, name, true, true);
       }
     };
     Object.defineProperty(HTMLElement.prototype, 'classList', {
-      get: function () {
+      get: function get() {
         if (this._classList) {
           return this._classList;
         }
@@ -524,9 +526,9 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
     }
     if (!('console' in window)) {
       window.console = {
-        log: function () {},
-        error: function () {},
-        warn: function () {}
+        log: function log() {},
+        error: function error() {},
+        warn: function warn() {}
       };
       return;
     }
@@ -676,7 +678,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       return;
     }
     Object.defineProperty(document, 'currentScript', {
-      get: function () {
+      get: function get() {
         var scripts = document.getElementsByTagName('script');
         return scripts[scripts.length - 1];
       },
@@ -695,10 +697,10 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       var inputProto = el.constructor.prototype;
       var typeProperty = Object.getOwnPropertyDescriptor(inputProto, 'type');
       Object.defineProperty(inputProto, 'type', {
-        get: function () {
+        get: function get() {
           return typeProperty.get.call(this);
         },
-        set: function (value) {
+        set: function set(value) {
           typeProperty.set.call(this, value === 'number' ? 'text' : value);
         },
         enumerable: true,
@@ -716,11 +718,11 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
     var documentProto = document.constructor.prototype;
     var readyStateProto = Object.getOwnPropertyDescriptor(documentProto, 'readyState');
     Object.defineProperty(documentProto, 'readyState', {
-      get: function () {
+      get: function get() {
         var value = readyStateProto.get.call(this);
         return value === 'interactive' ? 'loading' : value;
       },
-      set: function (value) {
+      set: function set(value) {
         readyStateProto.set.call(this, value);
       },
       enumerable: true,
@@ -1009,20 +1011,20 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       this.id = '$weakmap' + id++;
     }
     WeakMap.prototype = {
-      has: function (obj) {
+      has: function has(obj) {
         return !!Object.getOwnPropertyDescriptor(obj, this.id);
       },
-      get: function (obj, defaultValue) {
+      get: function get(obj, defaultValue) {
         return this.has(obj) ? obj[this.id] : defaultValue;
       },
-      set: function (obj, value) {
+      set: function set(obj, value) {
         Object.defineProperty(obj, this.id, {
           value: value,
           enumerable: false,
           configurable: true
         });
       },
-      delete: function (obj) {
+      delete: function _delete(obj) {
         delete obj[this.id];
       }
     };
@@ -1031,7 +1033,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
   (function checkURLConstructor() {
     var hasWorkingUrl = false;
     try {
-      if (typeof URL === 'function' && typeof URL.prototype === 'object' && 'origin' in URL.prototype) {
+      if (typeof URL === 'function' && _typeof(URL.prototype) === 'object' && 'origin' in URL.prototype) {
         var u = new URL('b', 'http://a');
         u.pathname = 'c%20d';
         hasWorkingUrl = u.href === 'http://a/c%20d';
@@ -1453,7 +1455,7 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
       parse.call(this, input, null, base);
     }
     JURL.prototype = {
-      toString: function () {
+      toString: function toString() {
         return this.href;
       },
       get href() {
@@ -1582,6 +1584,8 @@ if (typeof PDFJS === 'undefined' || !PDFJS.compatibilityChecked) {
 "use strict";
 
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var g;
 g = function () {
   return this;
@@ -1589,7 +1593,7 @@ g = function () {
 try {
   g = g || Function("return this")() || (1, eval)("this");
 } catch (e) {
-  if (typeof window === "object") g = window;
+  if ((typeof window === "undefined" ? "undefined" : _typeof(window)) === "object") g = window;
 }
 module.exports = g;
 

+ 64 - 59
web/pdf_viewer.js

@@ -768,6 +768,8 @@ Object.defineProperty(exports, "__esModule", {
 });
 exports.SimpleLinkService = exports.PDFLinkService = undefined;
 
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var _dom_events = __w_pdfjs_require__(2);
 
 var _ui_utils = __w_pdfjs_require__(0);
@@ -810,7 +812,7 @@ var PDFLinkService = function PDFLinkServiceClosure() {
     navigateTo: function PDFLinkService_navigateTo(dest) {
       var destString = '';
       var self = this;
-      var goToDestination = function (destRef) {
+      var goToDestination = function goToDestination(destRef) {
         var pageNumber;
         if (destRef instanceof Object) {
           pageNumber = self._cachedPageNumber(destRef);
@@ -990,7 +992,7 @@ var PDFLinkService = function PDFLinkServiceClosure() {
         action: action
       });
     },
-    onFileAttachmentAnnotation: function (params) {
+    onFileAttachmentAnnotation: function onFileAttachmentAnnotation(params) {
       this.eventBus.dispatch('fileattachmentannotation', {
         source: this,
         id: params.id,
@@ -1017,11 +1019,11 @@ var PDFLinkService = function PDFLinkServiceClosure() {
       return false;
     }
     var page = dest[0];
-    if (!(typeof page === 'object' && typeof page.num === 'number' && (page.num | 0) === page.num && typeof page.gen === 'number' && (page.gen | 0) === page.gen) && !(typeof page === 'number' && (page | 0) === page && page >= 0)) {
+    if (!((typeof page === 'undefined' ? 'undefined' : _typeof(page)) === 'object' && typeof page.num === 'number' && (page.num | 0) === page.num && typeof page.gen === 'number' && (page.gen | 0) === page.gen) && !(typeof page === 'number' && (page | 0) === page && page >= 0)) {
       return false;
     }
     var zoom = dest[1];
-    if (!(typeof zoom === 'object' && typeof zoom.name === 'string')) {
+    if (!((typeof zoom === 'undefined' ? 'undefined' : _typeof(zoom)) === 'object' && typeof zoom.name === 'string')) {
       return false;
     }
     switch (zoom.name) {
@@ -1067,17 +1069,17 @@ var SimpleLinkService = function SimpleLinkServiceClosure() {
       return 0;
     },
     set page(value) {},
-    navigateTo: function (dest) {},
-    getDestinationHash: function (dest) {
+    navigateTo: function navigateTo(dest) {},
+    getDestinationHash: function getDestinationHash(dest) {
       return '#';
     },
-    getAnchorUrl: function (hash) {
+    getAnchorUrl: function getAnchorUrl(hash) {
       return '#';
     },
-    setHash: function (hash) {},
-    executeNamedAction: function (action) {},
-    onFileAttachmentAnnotation: function (params) {},
-    cachePageRef: function (pageNum, pageRef) {}
+    setHash: function setHash(hash) {},
+    executeNamedAction: function executeNamedAction(action) {},
+    onFileAttachmentAnnotation: function onFileAttachmentAnnotation(params) {},
+    cachePageRef: function cachePageRef(pageNum, pageRef) {}
   };
   return SimpleLinkService;
 }();
@@ -1115,9 +1117,9 @@ var CHARACTERS_TO_NORMALIZE = {
   '\u201D': '"',
   '\u201E': '"',
   '\u201F': '"',
-  '\u00BC': '1/4',
-  '\u00BD': '1/2',
-  '\u00BE': '3/4'
+  '\xBC': '1/4',
+  '\xBD': '1/2',
+  '\xBE': '3/4'
 };
 var PDFFindController = function PDFFindControllerClosure() {
   function PDFFindController(options) {
@@ -1619,7 +1621,7 @@ var AnnotationLayerBuilder = function AnnotationLayerBuilderClosure() {
 }();
 function DefaultAnnotationLayerFactory() {}
 DefaultAnnotationLayerFactory.prototype = {
-  createAnnotationLayerBuilder: function (pageDiv, pdfPage, renderInteractiveForms) {
+  createAnnotationLayerBuilder: function createAnnotationLayerBuilder(pageDiv, pdfPage, renderInteractiveForms) {
     return new AnnotationLayerBuilder({
       pageDiv: pageDiv,
       pdfPage: pdfPage,
@@ -2018,7 +2020,7 @@ var PDFPageView = function PDFPageViewClosure() {
         this.pdfPage.cleanup();
       }
     },
-    _resetZoomLayer: function (removeFromDOM) {
+    _resetZoomLayer: function _resetZoomLayer(removeFromDOM) {
       if (!this.zoomLayer) {
         return;
       }
@@ -2297,7 +2299,7 @@ var PDFPageView = function PDFPageViewClosure() {
       }
       return resultPromise;
     },
-    paintOnCanvas: function (canvasWrapper) {
+    paintOnCanvas: function paintOnCanvas(canvasWrapper) {
       var resolveRenderPromise, rejectRenderPromise;
       var promise = new Promise(function (resolve, reject) {
         resolveRenderPromise = resolve;
@@ -2305,10 +2307,10 @@ var PDFPageView = function PDFPageViewClosure() {
       });
       var result = {
         promise: promise,
-        onRenderContinue: function (cont) {
+        onRenderContinue: function onRenderContinue(cont) {
           cont();
         },
-        cancel: function () {
+        cancel: function cancel() {
           renderTask.cancel();
         }
       };
@@ -2317,7 +2319,7 @@ var PDFPageView = function PDFPageViewClosure() {
       canvas.id = 'page' + this.id;
       canvas.setAttribute('hidden', 'hidden');
       var isCanvasHidden = true;
-      var showCanvas = function () {
+      var showCanvas = function showCanvas() {
         if (isCanvasHidden) {
           canvas.removeAttribute('hidden');
           isCanvasHidden = false;
@@ -2381,7 +2383,7 @@ var PDFPageView = function PDFPageViewClosure() {
     },
     paintOnSvg: function PDFPageView_paintOnSvg(wrapper) {
       var cancelled = false;
-      var ensureNotCancelled = function () {
+      var ensureNotCancelled = function ensureNotCancelled() {
         if (cancelled) {
           if (_pdfjs.PDFJS.pdfjsNext) {
             throw new _pdfjs.RenderingCancelledException('Rendering cancelled, page ' + self.id, 'svg');
@@ -2408,10 +2410,10 @@ var PDFPageView = function PDFPageViewClosure() {
       });
       return {
         promise: promise,
-        onRenderContinue: function (cont) {
+        onRenderContinue: function onRenderContinue(cont) {
           cont();
         },
-        cancel: function () {
+        cancel: function cancel() {
           cancelled = true;
         }
       };
@@ -2525,7 +2527,7 @@ var PDFViewer = function pdfViewer() {
     get pagesCount() {
       return this._pages.length;
     },
-    getPageView: function (index) {
+    getPageView: function getPageView(index) {
       return this._pages[index];
     },
     get pageViewsReady() {
@@ -2625,7 +2627,7 @@ var PDFViewer = function pdfViewer() {
         this.update();
       }
     },
-    setDocument: function (pdfDocument) {
+    setDocument: function setDocument(pdfDocument) {
       if (this.pdfDocument) {
         this._cancelRendering();
         this._resetView();
@@ -2654,7 +2656,7 @@ var PDFViewer = function pdfViewer() {
         resolveOnePageRendered = resolve;
       });
       this.onePageRendered = onePageRendered;
-      var bindOnAfterAndBeforeDraw = function (pageView) {
+      var bindOnAfterAndBeforeDraw = function bindOnAfterAndBeforeDraw(pageView) {
         pageView.onBeforeDraw = function pdfViewLoadOnBeforeDraw() {
           self._buffer.push(this);
         };
@@ -2739,7 +2741,7 @@ var PDFViewer = function pdfViewer() {
         pageView.setPageLabel(label);
       }
     },
-    _resetView: function () {
+    _resetView: function _resetView() {
       this._pages = [];
       this._currentPageNumber = 1;
       this._currentScale = _ui_utils.UNKNOWN_SCALE;
@@ -2838,7 +2840,7 @@ var PDFViewer = function pdfViewer() {
         this._setScaleUpdatePages(scale, value, noScroll, true);
       }
     },
-    _resetCurrentPageView: function () {
+    _resetCurrentPageView: function _resetCurrentPageView() {
       if (this.isInPresentationMode) {
         this._setScale(this._currentScaleValue, true);
       }
@@ -2946,7 +2948,7 @@ var PDFViewer = function pdfViewer() {
         top: top
       });
     },
-    _updateLocation: function (firstPage) {
+    _updateLocation: function _updateLocation(firstPage) {
       var currentScale = this._currentScale;
       var currentScaleValue = this._currentScaleValue;
       var normalizedScaleValue = parseFloat(currentScaleValue) === currentScale ? Math.round(currentScale * 10000) / 100 : currentScaleValue;
@@ -3000,10 +3002,10 @@ var PDFViewer = function pdfViewer() {
         location: this._location
       });
     },
-    containsElement: function (element) {
+    containsElement: function containsElement(element) {
       return this.container.contains(element);
     },
-    focus: function () {
+    focus: function focus() {
       this.container.focus();
     },
     get isInPresentationMode() {
@@ -3015,7 +3017,7 @@ var PDFViewer = function pdfViewer() {
     get isHorizontalScrollbarEnabled() {
       return this.isInPresentationMode ? false : this.container.scrollWidth > this.container.clientWidth;
     },
-    _getVisiblePages: function () {
+    _getVisiblePages: function _getVisiblePages() {
       if (!this.isInPresentationMode) {
         return (0, _ui_utils.getVisibleElements)(this.container, this._pages, true);
       }
@@ -3031,7 +3033,7 @@ var PDFViewer = function pdfViewer() {
         views: visible
       };
     },
-    cleanup: function () {
+    cleanup: function cleanup() {
       for (var i = 0, ii = this._pages.length; i < ii; i++) {
         if (this._pages[i] && this._pages[i].renderingState !== _pdf_rendering_queue.RenderingStates.FINISHED) {
           this._pages[i].reset();
@@ -3045,7 +3047,7 @@ var PDFViewer = function pdfViewer() {
         }
       }
     },
-    _ensurePdfPageLoaded: function (pageView) {
+    _ensurePdfPageLoaded: function _ensurePdfPageLoaded(pageView) {
       if (pageView.pdfPage) {
         return Promise.resolve(pageView.pdfPage);
       }
@@ -3061,7 +3063,7 @@ var PDFViewer = function pdfViewer() {
       this._pagesRequests[pageNumber] = promise;
       return promise;
     },
-    forceRendering: function (currentlyVisiblePages) {
+    forceRendering: function forceRendering(currentlyVisiblePages) {
       var visiblePages = currentlyVisiblePages || this._getVisiblePages();
       var pageView = this.renderingQueue.getHighestPriority(visiblePages, this._pages, this.scroll.down);
       if (pageView) {
@@ -3072,12 +3074,12 @@ var PDFViewer = function pdfViewer() {
       }
       return false;
     },
-    getPageTextContent: function (pageIndex) {
+    getPageTextContent: function getPageTextContent(pageIndex) {
       return this.pdfDocument.getPage(pageIndex + 1).then(function (page) {
         return page.getTextContent({ normalizeWhitespace: true });
       });
     },
-    createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
+    createTextLayerBuilder: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
       return new _text_layer_builder.TextLayerBuilder({
         textLayerDiv: textLayerDiv,
         eventBus: this.eventBus,
@@ -3087,7 +3089,7 @@ var PDFViewer = function pdfViewer() {
         enhanceTextSelection: this.isInPresentationMode ? false : enhanceTextSelection
       });
     },
-    createAnnotationLayerBuilder: function (pageDiv, pdfPage, renderInteractiveForms) {
+    createAnnotationLayerBuilder: function createAnnotationLayerBuilder(pageDiv, pdfPage, renderInteractiveForms) {
       return new _annotation_layer_builder.AnnotationLayerBuilder({
         pageDiv: pageDiv,
         pdfPage: pdfPage,
@@ -3096,10 +3098,10 @@ var PDFViewer = function pdfViewer() {
         downloadManager: this.downloadManager
       });
     },
-    setFindController: function (findController) {
+    setFindController: function setFindController(findController) {
       this.findController = findController;
     },
-    getPagesOverview: function () {
+    getPagesOverview: function getPagesOverview() {
       var pagesOverview = this._pages.map(function (pageView) {
         var viewport = pageView.pdfPage.getViewport(1);
         return {
@@ -3400,7 +3402,7 @@ var TextLayerBuilder = function TextLayerBuilderClosure() {
 }();
 function DefaultTextLayerFactory() {}
 DefaultTextLayerFactory.prototype = {
-  createTextLayerBuilder: function (textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
+  createTextLayerBuilder: function createTextLayerBuilder(textLayerDiv, pageIndex, viewport, enhanceTextSelection) {
     return new TextLayerBuilder({
       textLayerDiv: textLayerDiv,
       pageIndex: pageIndex,
@@ -3422,6 +3424,9 @@ exports.DefaultTextLayerFactory = DefaultTextLayerFactory;
 Object.defineProperty(exports, "__esModule", {
   value: true
 });
+
+var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
+
 var defaultPreferences = null;
 function getDefaultPreferences() {
   if (!defaultPreferences) {
@@ -3506,8 +3511,8 @@ var Preferences = {
       } else if (value === undefined) {
         throw new Error('preferencesSet: no value is specified.');
       }
-      var valueType = typeof value;
-      var defaultType = typeof this.defaults[name];
+      var valueType = typeof value === "undefined" ? "undefined" : _typeof(value);
+      var defaultType = _typeof(this.defaults[name]);
       if (valueType !== defaultType) {
         if (valueType === 'number' && defaultType === 'string') {
           value = value.toString();
@@ -3692,11 +3697,11 @@ function configure(PDFJS) {
   PDFJS.cMapPacked = true;
 }
 var DefaultExternalServices = {
-  updateFindControlState: function (data) {},
-  initPassiveLoading: function (callbacks) {},
-  fallback: function (data, callback) {},
-  reportTelemetry: function (data) {},
-  createDownloadManager: function () {
+  updateFindControlState: function updateFindControlState(data) {},
+  initPassiveLoading: function initPassiveLoading(callbacks) {},
+  fallback: function fallback(data, callback) {},
+  reportTelemetry: function reportTelemetry(data) {},
+  createDownloadManager: function createDownloadManager() {
     throw new Error('Not implemented: createDownloadManager');
   },
   supportsIntegratedFind: false,
@@ -3768,7 +3773,7 @@ var PDFViewerApplication = {
       self.initialized = true;
     });
   },
-  _readPreferences: function () {
+  _readPreferences: function _readPreferences() {
     var self = this;
     return Promise.all([_preferences.Preferences.get('enableWebGL').then(function resolved(value) {
       _pdfjs.PDFJS.disableWebGL = !value;
@@ -3821,7 +3826,7 @@ var PDFViewerApplication = {
       self.viewerPrefs['enablePrintAutoRotate'] = value;
     })]).catch(function (reason) {});
   },
-  _initializeViewerComponents: function () {
+  _initializeViewerComponents: function _initializeViewerComponents() {
     var self = this;
     var appConfig = this.appConfig;
     return new Promise(function (resolve, reject) {
@@ -5170,7 +5175,7 @@ _ui_utils.localized.then(function webViewerLocalized() {
 var PDFPrintServiceFactory = {
   instance: {
     supportsPrinting: false,
-    createPrintService: function () {
+    createPrintService: function createPrintService() {
       throw new Error('Not implemented: createPrintService');
     }
   }
@@ -5832,7 +5837,7 @@ var PDFFindBar = function PDFFindBarClosure() {
       this.updateResultsCount(matchCount);
       this._adjustWidth();
     },
-    updateResultsCount: function (matchCount) {
+    updateResultsCount: function updateResultsCount(matchCount) {
       if (!this.findResultsCount) {
         return;
       }
@@ -6551,7 +6556,7 @@ var PDFSidebar = function PDFSidebarClosure() {
       }
       thumbnailViewer.scrollThumbnailIntoView(pdfViewer.currentPageNumber);
     },
-    _showUINotification: function (view) {
+    _showUINotification: function _showUINotification(view) {
       if (this.disableNotification) {
         return;
       }
@@ -6570,7 +6575,7 @@ var PDFSidebar = function PDFSidebarClosure() {
           break;
       }
     },
-    _hideUINotification: function (view) {
+    _hideUINotification: function _hideUINotification(view) {
       if (this.disableNotification) {
         return;
       }
@@ -7090,7 +7095,7 @@ var PDFThumbnailViewer = function PDFThumbnailViewerClosure() {
       this._pagesRequests[pageNumber] = promise;
       return promise;
     },
-    forceRendering: function () {
+    forceRendering: function forceRendering() {
       var visibleThumbs = this._getVisibleThumbs();
       var thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this.thumbnails, this.scroll.down);
       if (thumbView) {
@@ -7342,22 +7347,22 @@ var Toolbar = function ToolbarClosure() {
     this._bindListeners();
   }
   Toolbar.prototype = {
-    setPageNumber: function (pageNumber, pageLabel) {
+    setPageNumber: function setPageNumber(pageNumber, pageLabel) {
       this.pageNumber = pageNumber;
       this.pageLabel = pageLabel;
       this._updateUIState(false);
     },
-    setPagesCount: function (pagesCount, hasPageLabels) {
+    setPagesCount: function setPagesCount(pagesCount, hasPageLabels) {
       this.pagesCount = pagesCount;
       this.hasPageLabels = hasPageLabels;
       this._updateUIState(true);
     },
-    setPageScale: function (pageScaleValue, pageScale) {
+    setPageScale: function setPageScale(pageScaleValue, pageScale) {
       this.pageScaleValue = pageScaleValue;
       this.pageScale = pageScale;
       this._updateUIState(false);
     },
-    reset: function () {
+    reset: function reset() {
       this.pageNumber = 0;
       this.pageLabel = null;
       this.hasPageLabels = false;

部分文件因文件數量過多而無法顯示