From de408dac70a56e9dd007557b5d89894ff5d1d6d0 Mon Sep 17 00:00:00 2001 From: Kalervo Kujala Date: Tue, 27 Sep 2011 21:43:48 +0300 Subject: [PATCH] Fix lint warnings. And name anonymous functions. --- examples/helloworld/hello.js | 2 +- pdf.js | 10 +++++----- test/driver.js | 2 +- web/viewer.js | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/helloworld/hello.js b/examples/helloworld/hello.js index 3b0f6dca7..9c653ca24 100644 --- a/examples/helloworld/hello.js +++ b/examples/helloworld/hello.js @@ -7,7 +7,7 @@ 'use strict'; -getPdf('helloworld.pdf', function(data){ +getPdf('helloworld.pdf', function getPdfHelloWorld(data) { // // Instantiate PDFDoc with PDF data // diff --git a/pdf.js b/pdf.js index 197c6e6d8..cb4296c79 100644 --- a/pdf.js +++ b/pdf.js @@ -129,16 +129,16 @@ function getPdf(arg, callback) { xhr.mozResponseType = xhr.responseType = 'arraybuffer'; xhr.expected = (document.URL.indexOf('file:') === 0) ? 0 : 200; xhr.onprogress = params.progress || undefined; - - xhr.onreadystatechange = function() { + + xhr.onreadystatechange = function getPdfOnreadystatechange() { var data; if (xhr.readyState === 4 && xhr.status === xhr.expected) { data = (xhr.mozResponseArrayBuffer || xhr.mozResponse || - xhr.responseArrayBuffer || xhr.response); + xhr.responseArrayBuffer || xhr.response); callback(data); } }; - xhr.send(null); + xhr.send(null); } var Stream = (function streamStream() { @@ -4965,7 +4965,7 @@ var CanvasGraphics = (function canvasGraphics() { if (IsDict(extGState) && extGState.has(dictName.name)) { var gsState = this.xref.fetchIfRef(extGState.get(dictName.name)); var self = this; - gsState.forEach(function(key, value) { + gsState.forEach(function canvasGraphicsSetGStateForEach(key, value) { switch (key) { case 'Type': break; diff --git a/test/driver.js b/test/driver.js index e948835dd..7162af6f3 100644 --- a/test/driver.js +++ b/test/driver.js @@ -73,7 +73,7 @@ function nextTask() { log('Loading file "' + task.file + '"\n'); - getPdf(task.file, function(data){ + getPdf(task.file, function nextTaskGetPdf(data) { var failure; try { task.pdfDoc = new PDFDoc(data); diff --git a/web/viewer.js b/web/viewer.js index 2cc3aaa4f..7515979f2 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -107,7 +107,7 @@ var PDFView = { document.title = url; - getPdf({url:url, progress:PDFView.progressLevel}, function(data) { + getPdf({url: url, progress: PDFView.progressLevel}, function(data) { document.getElementById('loading').style.display = 'none'; PDFView.load(data, scale); });