Use strict in driver.js.

And declare undeclared variables.
This commit is contained in:
Kalervo Kujala 2011-08-06 22:54:16 +03:00
parent 8110c585b2
commit 17e02e3c39

View File

@ -5,6 +5,8 @@
* A Test Driver for PDF.js * A Test Driver for PDF.js
*/ */
'use strict';
var appPath, browser, canvas, currentTaskIdx, manifest, stdout; var appPath, browser, canvas, currentTaskIdx, manifest, stdout;
function queryParams() { function queryParams() {
@ -21,7 +23,7 @@ function queryParams() {
function load() { function load() {
var params = queryParams(); var params = queryParams();
browser = params.browser; browser = params.browser;
manifestFile = params.manifestFile; var manifestFile = params.manifestFile;
appPath = params.path; appPath = params.path;
canvas = document.createElement("canvas"); canvas = document.createElement("canvas");
@ -134,7 +136,7 @@ function snapshotCurrentPage(page, task, failure) {
log("done"+ (failure ? " (failed!: "+ failure +")" : "") +"\n"); log("done"+ (failure ? " (failed!: "+ failure +")" : "") +"\n");
// Set up the next request // Set up the next request
backoff = (inFlightRequests > 0) ? inFlightRequests * 10 : 0; var backoff = (inFlightRequests > 0) ? inFlightRequests * 10 : 0;
setTimeout(function() { setTimeout(function() {
++task.pageNum, nextPage(task); ++task.pageNum, nextPage(task);
}, },
@ -209,4 +211,4 @@ function checkScrolling() {
function log(str) { function log(str) {
stdout.innerHTML += str; stdout.innerHTML += str;
checkScrolling(); checkScrolling();
} }