Updated to current latest stable version of jshint.

This commit is contained in:
Mitar 2014-02-09 23:30:39 -08:00
parent 5c40d686d4
commit 2c82e720b8
10 changed files with 18 additions and 12 deletions

View File

@ -2,7 +2,6 @@
// Environments // Environments
"browser": true, "browser": true,
"devel": true, "devel": true,
"es5": true,
"worker": true, "worker": true,
// Enforcing // Enforcing

View File

@ -12,11 +12,14 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
'use strict';
var url = location.search.match(/[&?]file=([^&]+)/i); var url = location.search.match(/[&?]file=([^&]+)/i);
if (url) { if (url) {
url = decodeURIComponent(url[1]); url = decodeURIComponent(url[1]);
document.body.textContent = url; document.body.textContent = url;
// Set cursor to end of the content-editable section. // Set cursor to end of the content-editable section.
getSelection().selectAllChildren(document.body); window.getSelection().selectAllChildren(document.body);
getSelection().collapseToEnd(); window.getSelection().collapseToEnd();
} }

View File

@ -26,7 +26,7 @@
- Removes window._ assignment. - Removes window._ assignment.
*/ */
/*jshint browser: true, devel: true, es5: true, globalstrict: true */ /*jshint browser: true, devel: true, globalstrict: true */
'use strict'; 'use strict';
document.webL10n = (function(window, document, undefined) { document.webL10n = (function(window, document, undefined) {

View File

@ -1138,7 +1138,7 @@ target.lint = function() {
var jshintPath = path.normalize('./node_modules/.bin/jshint'); var jshintPath = path.normalize('./node_modules/.bin/jshint');
if (!test('-f', jshintPath)) { if (!test('-f', jshintPath)) {
echo('jshint is not installed -- installing...'); echo('jshint is not installed -- installing...');
exec('npm install jshint@1.1'); // TODO read version from package.json exec('npm install jshint@2.4.x'); // TODO read version from package.json
} }
exit(exec('"' + jshintPath + '" --reporter test/reporter.js ' + exit(exec('"' + jshintPath + '" --reporter test/reporter.js ' +

View File

@ -2,7 +2,7 @@
"name": "pdf.js", "name": "pdf.js",
"version": "0.8.0", "version": "0.8.0",
"dependencies": { "dependencies": {
"jshint": "1.1.x" "jshint": "2.4.x"
}, },
"scripts": { "scripts": {
"test": "node make lint" "test": "node make lint"

View File

@ -1384,7 +1384,7 @@ var OperatorList = (function OperatorListClosure() {
this.fnArray = []; this.fnArray = [];
} }
this.argsArray = []; this.argsArray = [];
this.dependencies = {}, this.dependencies = {};
this.pageIndex = pageIndex; this.pageIndex = pageIndex;
this.fnIndex = 0; this.fnIndex = 0;
} }
@ -1471,11 +1471,11 @@ var TextState = (function TextStateClosure() {
TextState.prototype = { TextState.prototype = {
initialiseTextObj: function TextState_initialiseTextObj() { initialiseTextObj: function TextState_initialiseTextObj() {
var m = this.textMatrix; var m = this.textMatrix;
m[0] = 1, m[1] = 0, m[2] = 0, m[3] = 1, m[4] = 0, m[5] = 0; m[0] = 1; m[1] = 0; m[2] = 0; m[3] = 1; m[4] = 0; m[5] = 0;
}, },
setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) { setTextMatrix: function TextState_setTextMatrix(a, b, c, d, e, f) {
var m = this.textMatrix; var m = this.textMatrix;
m[0] = a, m[1] = b, m[2] = c, m[3] = d, m[4] = e, m[5] = f; m[0] = a; m[1] = b; m[2] = c; m[3] = d; m[4] = e; m[5] = f;
}, },
translateTextMatrix: function TextState_translateTextMatrix(x, y) { translateTextMatrix: function TextState_translateTextMatrix(x, y) {
var m = this.textMatrix; var m = this.textMatrix;

View File

@ -1725,19 +1725,19 @@ var JpxImage = (function JpxImageClosure() {
} }
} }
for (i = 0; i < hlHeight; i++) { for (i = 0; i < hlHeight; i++) {
k = i * hlWidth, l = i * 2 * width + 1; k = i * hlWidth; l = i * 2 * width + 1;
for (j = 0; j < hlWidth; j++, k++, l += 2) { for (j = 0; j < hlWidth; j++, k++, l += 2) {
items[l] = hlItems[k]; items[l] = hlItems[k];
} }
} }
for (i = 0; i < lhHeight; i++) { for (i = 0; i < lhHeight; i++) {
k = i * lhWidth, l = (i * 2 + 1) * width; k = i * lhWidth; l = (i * 2 + 1) * width;
for (j = 0; j < lhWidth; j++, k++, l += 2) { for (j = 0; j < lhWidth; j++, k++, l += 2) {
items[l] = lhItems[k]; items[l] = lhItems[k];
} }
} }
for (i = 0; i < hhHeight; i++) { for (i = 0; i < hhHeight; i++) {
k = i * hhWidth, l = (i * 2 + 1) * width + 1; k = i * hhWidth; l = (i * 2 + 1) * width + 1;
for (j = 0; j < hhWidth; j++, k++, l += 2) { for (j = 0; j < hhWidth; j++, k++, l += 2) {
items[l] = hhItems[k]; items[l] = hhItems[k];
} }

View File

@ -14,6 +14,7 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/*jshint globalstrict: false */
// Initializing PDFJS global object (if still undefined) // Initializing PDFJS global object (if still undefined)
if (typeof PDFJS === 'undefined') { if (typeof PDFJS === 'undefined') {

View File

@ -15,6 +15,8 @@
* limitations under the License. * limitations under the License.
*/ */
'use strict';
var CFFEncodingMap = { var CFFEncodingMap = {
'0': '-reserved-', '0': '-reserved-',
'1': 'hstem', '1': 'hstem',

View File

@ -1,5 +1,6 @@
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
/*jshint globalstrict: false */
var TestReporter = function(browser, appPath) { var TestReporter = function(browser, appPath) {
'use strict'; 'use strict';