From ad915f8af1c54e6205c02f0dea62ea98ccefd926 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sat, 10 Dec 2016 19:58:36 +0100 Subject: [PATCH] Fix errors reported by the `comma-spacing` ESLint rule http://eslint.org/docs/rules/comma-spacing --- extensions/chromium/pdfHandler.js | 4 ++-- make.js | 2 +- src/core/annotation.js | 2 +- src/core/crypto.js | 28 ++++++++++++++-------------- src/display/svg.js | 4 ++-- src/display/webgl.js | 2 +- src/shared/cffStandardStrings.js | 2 +- test/unit/crypto_spec.js | 8 ++++---- web/pdf_document_properties.js | 20 ++++++++++---------- 9 files changed, 36 insertions(+), 36 deletions(-) diff --git a/extensions/chromium/pdfHandler.js b/extensions/chromium/pdfHandler.js index d32491f6c..6e0b99817 100644 --- a/extensions/chromium/pdfHandler.js +++ b/extensions/chromium/pdfHandler.js @@ -72,7 +72,7 @@ function getHeaderFromHeaders(headers, headerName) { function isPdfFile(details) { var header = getHeaderFromHeaders(details.responseHeaders, 'content-type'); if (header) { - var headerValue = header.value.toLowerCase().split(';',1)[0].trim(); + var headerValue = header.value.toLowerCase().split(';', 1)[0].trim(); if (headerValue === 'application/pdf') { return true; } @@ -153,7 +153,7 @@ chrome.webRequest.onHeadersReceived.addListener( ], types: ['main_frame', 'sub_frame'] }, - ['blocking','responseHeaders']); + ['blocking', 'responseHeaders']); chrome.webRequest.onBeforeRequest.addListener( function onBeforeRequestForFTP(details) { diff --git a/make.js b/make.js index 1a8fc73fd..80cf970d9 100644 --- a/make.js +++ b/make.js @@ -883,7 +883,7 @@ target.chromium = function() { 'extensions/chromium/*.html', 'extensions/chromium/*.js', 'extensions/chromium/*.css', - 'extensions/chromium/icon*.png',], + 'extensions/chromium/icon*.png'], CHROME_BUILD_DIR], ['extensions/chromium/pageAction/*.*', CHROME_BUILD_DIR + '/pageAction'], ['extensions/chromium/options/*.*', CHROME_BUILD_DIR + '/options'], diff --git a/src/core/annotation.js b/src/core/annotation.js index 9c5b2f5b8..7fb6a13f4 100644 --- a/src/core/annotation.js +++ b/src/core/annotation.js @@ -435,7 +435,7 @@ var Annotation = (function AnnotationClosure() { // Properties ]); var bbox = appearanceDict.getArray('BBox') || [0, 0, 1, 1]; - var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0 ,0]; + var matrix = appearanceDict.getArray('Matrix') || [1, 0, 0, 1, 0, 0]; var transform = getTransformMatrix(data.rect, bbox, matrix); var self = this; diff --git a/src/core/crypto.js b/src/core/crypto.js index d1fa3929a..b7e3bd5f7 100644 --- a/src/core/crypto.js +++ b/src/core/crypto.js @@ -609,22 +609,22 @@ var calculateSHA512 = (function calculateSHA512Closure() { var result; if (!mode384) { result = new Uint8Array(64); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); - h6.copyTo(result,48); - h7.copyTo(result,56); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); + h6.copyTo(result, 48); + h7.copyTo(result, 56); } else { result = new Uint8Array(48); - h0.copyTo(result,0); - h1.copyTo(result,8); - h2.copyTo(result,16); - h3.copyTo(result,24); - h4.copyTo(result,32); - h5.copyTo(result,40); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); } return result; } diff --git a/src/display/svg.js b/src/display/svg.js index 92be5e788..9530095c7 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -841,7 +841,7 @@ var SVGGraphics = (function SVGGraphicsClosure() { var height = args[j++]; var xw = x + width; var yh = y + height; - d.push('M', pf(x), pf(y), 'L', pf(xw) , pf(y), 'L', pf(xw), pf(yh), + d.push('M', pf(x), pf(y), 'L', pf(xw), pf(y), 'L', pf(xw), pf(yh), 'L', pf(x), pf(yh), 'Z'); break; case OPS.moveTo: @@ -852,7 +852,7 @@ var SVGGraphics = (function SVGGraphicsClosure() { case OPS.lineTo: x = args[j++]; y = args[j++]; - d.push('L', pf(x) , pf(y)); + d.push('L', pf(x), pf(y)); break; case OPS.curveTo: x = args[j + 4]; diff --git a/src/display/webgl.js b/src/display/webgl.js index 83c64a707..4c02fd7ca 100644 --- a/src/display/webgl.js +++ b/src/display/webgl.js @@ -186,7 +186,7 @@ var WebGLUtils = (function WebGLUtilsClosure() { if (!smaskCache) { initSmaskGL(); } - var cache = smaskCache,canvas = cache.canvas, gl = cache.gl; + var cache = smaskCache, canvas = cache.canvas, gl = cache.gl; canvas.width = width; canvas.height = height; gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight); diff --git a/src/shared/cffStandardStrings.js b/src/shared/cffStandardStrings.js index 7fa8ef782..fbfc1378b 100644 --- a/src/shared/cffStandardStrings.js +++ b/src/shared/cffStandardStrings.js @@ -148,7 +148,7 @@ var CFFDictDataMap = { }, '7': { name: 'FontMatrix', - operand: [0.001, 0, 0, 0.001, 0 , 0] + operand: [0.001, 0, 0, 0.001, 0, 0] }, '8': { name: 'StrokeWidth', diff --git a/test/unit/crypto_spec.js b/test/unit/crypto_spec.js index 4d67bc9a0..f4b7aa2b5 100644 --- a/test/unit/crypto_spec.js +++ b/test/unit/crypto_spec.js @@ -250,7 +250,7 @@ describe('crypto', function() { key = hex2binary('000102030405060708090a0b0c0d0e0f'); iv = hex2binary('00000000000000000000000000000000'); cipher = new AES128Cipher(key); - result = cipher.encrypt(input,iv); + result = cipher.encrypt(input, iv); expected = hex2binary('69c4e0d86a7b0430d8cdb78070b4c55a'); expect(result).toEqual(expected); }); @@ -279,7 +279,7 @@ describe('crypto', function() { '191a1b1c1d1e1f'); iv = hex2binary('00000000000000000000000000000000'); cipher = new AES256Cipher(key); - result = cipher.encrypt(input,iv); + result = cipher.encrypt(input, iv); expected = hex2binary('8ea2b7ca516745bfeafc49904b496089'); expect(result).toEqual(expected); }); @@ -293,7 +293,7 @@ describe('crypto', function() { '191a1b1c1d1e1f'); iv = hex2binary('00000000000000000000000000000000'); cipher = new AES256Cipher(key); - result = cipher.decryptBlock(input,false,iv); + result = cipher.decryptBlock(input, false, iv); expected = hex2binary('00112233445566778899aabbccddeeff'); expect(result).toEqual(expected); }); @@ -304,7 +304,7 @@ describe('crypto', function() { key = hex2binary('000102030405060708090a0b0c0d0e0f101112131415161718' + '191a1b1c1d1e1f'); cipher = new AES256Cipher(key); - result = cipher.decryptBlock(input,false); + result = cipher.decryptBlock(input, false); expected = hex2binary('00112233445566778899aabbccddeeff'); expect(result).toEqual(expected); }); diff --git a/web/pdf_document_properties.js b/web/pdf_document_properties.js index 141c499a1..0e7471c39 100644 --- a/web/pdf_document_properties.js +++ b/web/pdf_document_properties.js @@ -200,22 +200,22 @@ var PDFDocumentProperties = (function PDFDocumentPropertiesClosure() { } // Remove the D: prefix if it is available. - if (dateToParse.substring(0,2) === 'D:') { + if (dateToParse.substring(0, 2) === 'D:') { dateToParse = dateToParse.substring(2); } // Get all elements from the PDF date string. // JavaScript's Date object expects the month to be between // 0 and 11 instead of 1 and 12, so we're correcting for this. - var year = parseInt(dateToParse.substring(0,4), 10); - var month = parseInt(dateToParse.substring(4,6), 10) - 1; - var day = parseInt(dateToParse.substring(6,8), 10); - var hours = parseInt(dateToParse.substring(8,10), 10); - var minutes = parseInt(dateToParse.substring(10,12), 10); - var seconds = parseInt(dateToParse.substring(12,14), 10); - var utRel = dateToParse.substring(14,15); - var offsetHours = parseInt(dateToParse.substring(15,17), 10); - var offsetMinutes = parseInt(dateToParse.substring(18,20), 10); + var year = parseInt(dateToParse.substring(0, 4), 10); + var month = parseInt(dateToParse.substring(4, 6), 10) - 1; + var day = parseInt(dateToParse.substring(6, 8), 10); + var hours = parseInt(dateToParse.substring(8, 10), 10); + var minutes = parseInt(dateToParse.substring(10, 12), 10); + var seconds = parseInt(dateToParse.substring(12, 14), 10); + var utRel = dateToParse.substring(14, 15); + var offsetHours = parseInt(dateToParse.substring(15, 17), 10); + var offsetMinutes = parseInt(dateToParse.substring(18, 20), 10); // As per spec, utRel = 'Z' means equal to universal time. // The other cases ('-' and '+') have to be handled here.