[Pkg-javascript-commits] [pdf.js] 76/141: Fixes lint warning W004 in /web

David Prévot taffit at moszumanska.debian.org
Sat Apr 19 22:40:32 UTC 2014


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit b34824386636cde5a72b8c8b19d15de8f4192ef2
Author: Tim van der Meij <timvandermeij at gmail.com>
Date:   Mon Apr 7 22:34:03 2014 +0200

    Fixes lint warning W004 in /web
---
 web/compatibility.js |  6 +++---
 web/debugger.js      |  9 +++++----
 web/viewer.js        | 14 ++++++++------
 3 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/web/compatibility.js b/web/compatibility.js
index a740271..21ac29f 100644
--- a/web/compatibility.js
+++ b/web/compatibility.js
@@ -58,17 +58,17 @@ if (typeof PDFJS === 'undefined') {
   }
 
   function TypedArray(arg1) {
-    var result;
+    var result, i, n;
     if (typeof arg1 === 'number') {
       result = [];
-      for (var i = 0; i < arg1; ++i) {
+      for (i = 0; i < arg1; ++i) {
         result[i] = 0;
       }
     } else if ('slice' in arg1) {
       result = arg1.slice(0);
     } else {
       result = [];
-      for (var i = 0, n = arg1.length; i < n; ++i) {
+      for (i = 0, n = arg1.length; i < n; ++i) {
         result[i] = arg1[i];
       }
     }
diff --git a/web/debugger.js b/web/debugger.js
index 21e1193..ee217b9 100644
--- a/web/debugger.js
+++ b/web/debugger.js
@@ -211,10 +211,11 @@ var StepperManager = (function StepperManagerClosure() {
       return stepper;
     },
     selectStepper: function selectStepper(pageIndex, selectPanel) {
+      var i;
       if (selectPanel) {
         this.manager.selectPanel(this);
       }
-      for (var i = 0; i < steppers.length; ++i) {
+      for (i = 0; i < steppers.length; ++i) {
         var stepper = steppers[i];
         if (stepper.pageIndex == pageIndex) {
           stepper.panel.removeAttribute('hidden');
@@ -223,7 +224,7 @@ var StepperManager = (function StepperManagerClosure() {
         }
       }
       var options = stepperChooser.options;
-      for (var i = 0; i < options.length; ++i) {
+      for (i = 0; i < options.length; ++i) {
         var option = options[i];
         option.selected = option.value == pageIndex;
       }
@@ -344,7 +345,7 @@ var Stepper = (function StepperClosure() {
       var self = this;
       var chunk = document.createDocumentFragment();
       var operatorsToDisplay = Math.min(MAX_OPERATORS_COUNT,
-        operatorList.fnArray.length);
+                                        operatorList.fnArray.length);
       for (var i = this.operatorListIdx; i < operatorsToDisplay; i++) {
         var line = c('tr');
         line.className = 'line';
@@ -369,7 +370,7 @@ var Stepper = (function StepperClosure() {
         if (fn in glyphCommands) {
           var glyphIndex = glyphCommands[fn];
           var glyphs = args[glyphIndex];
-          var decArgs = args.slice();
+          decArgs = args.slice();
           var newArg;
           if (fn === 'showSpacedText') {
             newArg = [];
diff --git a/web/viewer.js b/web/viewer.js
index d7e8dc3..7003d9c 100644
--- a/web/viewer.js
+++ b/web/viewer.js
@@ -639,7 +639,7 @@ var PDFView = {
 
         if (exception && exception.name === 'InvalidPDFException') {
           // change error message also for other builds
-          var loadingErrorMessage = mozL10n.get('invalid_file_error', null,
+          loadingErrorMessage = mozL10n.get('invalid_file_error', null,
                                         'Invalid or corrupted PDF file.');
 //#if B2G
 //        window.alert(loadingErrorMessage);
@@ -649,7 +649,7 @@ var PDFView = {
 
         if (exception && exception.name === 'MissingPDFException') {
           // special message for missing PDF's
-          var loadingErrorMessage = mozL10n.get('missing_file_error', null,
+          loadingErrorMessage = mozL10n.get('missing_file_error', null,
                                         'Missing PDF file.');
 
 //#if B2G
@@ -1478,10 +1478,11 @@ var PDFView = {
     }
 
     var alertNotReady = false;
+    var i, ii;
     if (!this.pages.length) {
       alertNotReady = true;
     } else {
-      for (var i = 0, ii = this.pages.length; i < ii; ++i) {
+      for (i = 0, ii = this.pages.length; i < ii; ++i) {
         if (!this.pages[i].pdfPage) {
           alertNotReady = true;
           break;
@@ -1497,7 +1498,7 @@ var PDFView = {
 
     var body = document.querySelector('body');
     body.setAttribute('data-mozPrintCallback', true);
-    for (var i = 0, ii = this.pages.length; i < ii; ++i) {
+    for (i = 0, ii = this.pages.length; i < ii; ++i) {
       this.pages[i].beforePrint();
     }
   },
@@ -1511,14 +1512,15 @@ var PDFView = {
 
   rotatePages: function pdfViewRotatePages(delta) {
     var currentPage = this.pages[this.page - 1];
+    var i, l;
     this.pageRotation = (this.pageRotation + 360 + delta) % 360;
 
-    for (var i = 0, l = this.pages.length; i < l; i++) {
+    for (i = 0, l = this.pages.length; i < l; i++) {
       var page = this.pages[i];
       page.update(page.scale, this.pageRotation);
     }
 
-    for (var i = 0, l = this.thumbnails.length; i < l; i++) {
+    for (i = 0, l = this.thumbnails.length; i < l; i++) {
       var thumb = this.thumbnails[i];
       thumb.update(this.pageRotation);
     }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list