diff --git a/.jshintrc b/.jshintrc index c70a50b30..68db82eaa 100644 --- a/.jshintrc +++ b/.jshintrc @@ -2,7 +2,6 @@ // Environments "browser": true, "devel": true, - "es5": true, "worker": true, // Enforcing diff --git a/extensions/chromium/pageActionPopup.js b/extensions/chromium/pageActionPopup.js index 0c3c18459..457e0280b 100644 --- a/extensions/chromium/pageActionPopup.js +++ b/extensions/chromium/pageActionPopup.js @@ -12,11 +12,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + +'use strict'; + var url = location.search.match(/[&?]file=([^&]+)/i); if (url) { url = decodeURIComponent(url[1]); document.body.textContent = url; // Set cursor to end of the content-editable section. - getSelection().selectAllChildren(document.body); - getSelection().collapseToEnd(); + window.getSelection().selectAllChildren(document.body); + window.getSelection().collapseToEnd(); } diff --git a/external/webL10n/l10n.js b/external/webL10n/l10n.js index f13c8d60b..37f3950c5 100644 --- a/external/webL10n/l10n.js +++ b/external/webL10n/l10n.js @@ -26,7 +26,7 @@ - Removes window._ assignment. */ -/*jshint browser: true, devel: true, es5: true, globalstrict: true */ +/*jshint browser: true, devel: true, globalstrict: true */ 'use strict'; document.webL10n = (function(window, document, undefined) { diff --git a/make.js b/make.js index a9a4c63cc..cc6d935f3 100644 --- a/make.js +++ b/make.js @@ -1138,7 +1138,7 @@ target.lint = function() { var jshintPath = path.normalize('./node_modules/.bin/jshint'); if (!test('-f', jshintPath)) { 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 ' + diff --git a/package.json b/package.json index 19f59e98f..179e1a5b2 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pdf.js", "version": "0.8.0", "dependencies": { - "jshint": "1.1.x" + "jshint": "2.4.x" }, "scripts": { "test": "node make lint" diff --git a/src/core/evaluator.js b/src/core/evaluator.js index aeadbff15..021ae9d0e 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -1384,7 +1384,7 @@ var OperatorList = (function OperatorListClosure() { this.fnArray = []; } this.argsArray = []; - this.dependencies = {}, + this.dependencies = {}; this.pageIndex = pageIndex; this.fnIndex = 0; } @@ -1471,11 +1471,11 @@ var TextState = (function TextStateClosure() { TextState.prototype = { initialiseTextObj: function TextState_initialiseTextObj() { 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) { 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) { var m = this.textMatrix; diff --git a/src/core/jpx.js b/src/core/jpx.js index 23254df4b..34d9d2e6e 100644 --- a/src/core/jpx.js +++ b/src/core/jpx.js @@ -1725,19 +1725,19 @@ var JpxImage = (function JpxImageClosure() { } } 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) { items[l] = hlItems[k]; } } 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) { items[l] = lhItems[k]; } } 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) { items[l] = hhItems[k]; } diff --git a/src/pdf.js b/src/pdf.js index e185b51e8..a16d2fa0d 100644 --- a/src/pdf.js +++ b/src/pdf.js @@ -14,6 +14,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +/*jshint globalstrict: false */ // Initializing PDFJS global object (if still undefined) if (typeof PDFJS === 'undefined') { diff --git a/src/shared/cffStandardStrings.js b/src/shared/cffStandardStrings.js index 6af30317f..f1a829e10 100644 --- a/src/shared/cffStandardStrings.js +++ b/src/shared/cffStandardStrings.js @@ -15,6 +15,8 @@ * limitations under the License. */ +'use strict'; + var CFFEncodingMap = { '0': '-reserved-', '1': 'hstem', diff --git a/test/unit/testreporter.js b/test/unit/testreporter.js index a855cf836..72eb8777d 100644 --- a/test/unit/testreporter.js +++ b/test/unit/testreporter.js @@ -1,5 +1,6 @@ /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */ +/*jshint globalstrict: false */ var TestReporter = function(browser, appPath) { 'use strict';