2
0
Yury Delendik 10 жил өмнө
parent
commit
222c63a71d
5 өөрчлөгдсөн 56 нэмэгдсэн , 34 устгасан
  1. 1 1
      bower.json
  2. 26 15
      build/pdf.combined.js
  3. 2 2
      build/pdf.js
  4. 26 15
      build/pdf.worker.js
  5. 1 1
      package.json

+ 1 - 1
bower.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.0.416",
+  "version": "1.0.418",
   "keywords": [
     "Mozilla",
     "pdf",

+ 26 - 15
build/pdf.combined.js

@@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 
-PDFJS.version = '1.0.416';
-PDFJS.build = '7055671';
+PDFJS.version = '1.0.418';
+PDFJS.build = '3ad58db';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
@@ -22052,7 +22052,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
               var name = args[0].name;
               if (imageCache.key === name) {
                 operatorList.addOp(imageCache.fn, imageCache.args);
-                args = [];
+                args = null;
                 continue;
               }
 
@@ -22076,7 +22076,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
                 } else if (type.name === 'Image') {
                   self.buildPaintImageXObject(resources, xobj, false,
                     operatorList, name, imageCache);
-                  args = [];
+                  args = null;
                   continue;
                 } else if (type.name === 'PS') {
                   // PostScript XObjects are unused when viewing documents.
@@ -22102,12 +22102,12 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
               var cacheKey = args[0].cacheKey;
               if (cacheKey && imageCache.key === cacheKey) {
                 operatorList.addOp(imageCache.fn, imageCache.args);
-                args = [];
+                args = null;
                 continue;
               }
               self.buildPaintImageXObject(resources, args[0], true,
                 operatorList, cacheKey, imageCache);
-              args = [];
+              args = null;
               continue;
             case OPS.showText:
               args[0] = self.handleText(args[0], stateManager.state);
@@ -23498,7 +23498,9 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
     },
 
     read: function EvaluatorPreprocessor_read(operation) {
-      var args = [];
+      // We use an array to represent args, except we use |null| to represent
+      // no args because it's more compact than an empty array.
+      var args = null;
       while (true) {
         var obj = this.parser.getObj();
         if (isEOF(obj)) {
@@ -23507,6 +23509,9 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
         if (!isCmd(obj)) {
           // argument
           if (obj !== null) {
+            if (!args) {
+              args = [];
+            }
             args.push((obj instanceof Dict ? obj.getAll() : obj));
             assert(args.length <= 33, 'Too many arguments');
           }
@@ -23526,28 +23531,34 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
 
         if (!opSpec.variableArgs) {
           // Some post script commands can be nested, e.g. /F2 /GS2 gs 5.711 Tf
-          if (args.length !== numArgs) {
+          var argsLength = args !== null ? args.length : 0;
+          if (argsLength !== numArgs) {
             var nonProcessedArgs = this.nonProcessedArgs;
-            while (args.length > numArgs) {
+            while (argsLength > numArgs) {
               nonProcessedArgs.push(args.shift());
+              argsLength--;
             }
-            while (args.length < numArgs && nonProcessedArgs.length !== 0) {
+            while (argsLength < numArgs && nonProcessedArgs.length !== 0) {
+              if (!args) {
+                args = [];
+              }
               args.unshift(nonProcessedArgs.pop());
+              argsLength++;
             }
           }
 
-          if (args.length < numArgs) {
+          if (argsLength < numArgs) {
             // If we receive too few args, it's not possible to possible
             // to execute the command, so skip the command
             info('Command ' + fn + ': because expected ' +
-                 numArgs + ' args, but received ' + args.length +
+                 numArgs + ' args, but received ' + argsLength +
                  ' args; skipping');
-            args = [];
+            args = null;
             continue;
           }
-        } else if (args.length > numArgs) {
+        } else if (argsLength > numArgs) {
           info('Command ' + fn + ': expected [0,' + numArgs +
-               '] args, but received ' + args.length + ' args');
+               '] args, but received ' + argsLength + ' args');
         }
 
         // TODO figure out how to type-check vararg functions

+ 2 - 2
build/pdf.js

@@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 
-PDFJS.version = '1.0.416';
-PDFJS.build = '7055671';
+PDFJS.version = '1.0.418';
+PDFJS.build = '3ad58db';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it

+ 26 - 15
build/pdf.worker.js

@@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
   (typeof window !== 'undefined' ? window : this).PDFJS = {};
 }
 
-PDFJS.version = '1.0.416';
-PDFJS.build = '7055671';
+PDFJS.version = '1.0.418';
+PDFJS.build = '3ad58db';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
@@ -17216,7 +17216,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
               var name = args[0].name;
               if (imageCache.key === name) {
                 operatorList.addOp(imageCache.fn, imageCache.args);
-                args = [];
+                args = null;
                 continue;
               }
 
@@ -17240,7 +17240,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
                 } else if (type.name === 'Image') {
                   self.buildPaintImageXObject(resources, xobj, false,
                     operatorList, name, imageCache);
-                  args = [];
+                  args = null;
                   continue;
                 } else if (type.name === 'PS') {
                   // PostScript XObjects are unused when viewing documents.
@@ -17266,12 +17266,12 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
               var cacheKey = args[0].cacheKey;
               if (cacheKey && imageCache.key === cacheKey) {
                 operatorList.addOp(imageCache.fn, imageCache.args);
-                args = [];
+                args = null;
                 continue;
               }
               self.buildPaintImageXObject(resources, args[0], true,
                 operatorList, cacheKey, imageCache);
-              args = [];
+              args = null;
               continue;
             case OPS.showText:
               args[0] = self.handleText(args[0], stateManager.state);
@@ -18662,7 +18662,9 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
     },
 
     read: function EvaluatorPreprocessor_read(operation) {
-      var args = [];
+      // We use an array to represent args, except we use |null| to represent
+      // no args because it's more compact than an empty array.
+      var args = null;
       while (true) {
         var obj = this.parser.getObj();
         if (isEOF(obj)) {
@@ -18671,6 +18673,9 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
         if (!isCmd(obj)) {
           // argument
           if (obj !== null) {
+            if (!args) {
+              args = [];
+            }
             args.push((obj instanceof Dict ? obj.getAll() : obj));
             assert(args.length <= 33, 'Too many arguments');
           }
@@ -18690,28 +18695,34 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() {
 
         if (!opSpec.variableArgs) {
           // Some post script commands can be nested, e.g. /F2 /GS2 gs 5.711 Tf
-          if (args.length !== numArgs) {
+          var argsLength = args !== null ? args.length : 0;
+          if (argsLength !== numArgs) {
             var nonProcessedArgs = this.nonProcessedArgs;
-            while (args.length > numArgs) {
+            while (argsLength > numArgs) {
               nonProcessedArgs.push(args.shift());
+              argsLength--;
             }
-            while (args.length < numArgs && nonProcessedArgs.length !== 0) {
+            while (argsLength < numArgs && nonProcessedArgs.length !== 0) {
+              if (!args) {
+                args = [];
+              }
               args.unshift(nonProcessedArgs.pop());
+              argsLength++;
             }
           }
 
-          if (args.length < numArgs) {
+          if (argsLength < numArgs) {
             // If we receive too few args, it's not possible to possible
             // to execute the command, so skip the command
             info('Command ' + fn + ': because expected ' +
-                 numArgs + ' args, but received ' + args.length +
+                 numArgs + ' args, but received ' + argsLength +
                  ' args; skipping');
-            args = [];
+            args = null;
             continue;
           }
-        } else if (args.length > numArgs) {
+        } else if (argsLength > numArgs) {
           info('Command ' + fn + ': expected [0,' + numArgs +
-               '] args, but received ' + args.length + ' args');
+               '] args, but received ' + argsLength + ' args');
         }
 
         // TODO figure out how to type-check vararg functions

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "pdfjs-dist",
-  "version": "1.0.416",
+  "version": "1.0.418",
   "description": "Generic build of Mozilla's PDF.js library.",
   "keywords": [
     "Mozilla",