[Firefox addon] Enforce double quotes, using ESLint, to avoid linting errors in mozilla-central (issue 7957)

Given that this patch causes a lot of churn in the addon code, I wouldn't really mind if we ultimately decide against doing this and just add a rule exception in mozilla-central instead.[1]

---
[1] Note that I used the ESLint `--fix` option, hence writing this commit message actually took longer time than the creation of the patch :-)
This commit is contained in:
Jonas Jenwald 2017-01-23 23:41:56 +01:00
parent e0a92a7f48
commit a5d5b970af
13 changed files with 376 additions and 375 deletions

View file

@ -14,14 +14,14 @@
*/
/* globals Components, Services */
'use strict';
"use strict";
Components.utils.import('resource://gre/modules/Services.jsm');
Components.utils.import("resource://gre/modules/Services.jsm");
var EXPORTED_SYMBOLS = ['NetworkManager'];
var EXPORTED_SYMBOLS = ["NetworkManager"];
function log(aMsg) {
var msg = 'PdfJsNetwork.jsm: ' + (aMsg.join ? aMsg.join('') : aMsg);
var msg = "PdfJsNetwork.jsm: " + (aMsg.join ? aMsg.join("") : aMsg);
Services.console.logStringMessage(msg);
}
@ -32,7 +32,7 @@ var NetworkManager = (function NetworkManagerClosure() {
function getArrayBuffer(xhr) {
var data = xhr.response;
if (typeof data !== 'string') {
if (typeof data !== "string") {
return data;
}
var length = data.length;
@ -82,18 +82,18 @@ var NetworkManager = (function NetworkManagerClosure() {
xhr,
};
xhr.open('GET', this.url);
xhr.open("GET", this.url);
xhr.withCredentials = this.withCredentials;
for (var property in this.httpHeaders) {
var value = this.httpHeaders[property];
if (typeof value === 'undefined') {
if (typeof value === "undefined") {
continue;
}
xhr.setRequestHeader(property, value);
}
if (this.isHttp && 'begin' in args && 'end' in args) {
var rangeStr = args.begin + '-' + (args.end - 1);
xhr.setRequestHeader('Range', 'bytes=' + rangeStr);
if (this.isHttp && "begin" in args && "end" in args) {
var rangeStr = args.begin + "-" + (args.end - 1);
xhr.setRequestHeader("Range", "bytes=" + rangeStr);
pendingRequest.expectedStatus = 206;
} else {
pendingRequest.expectedStatus = 200;
@ -101,11 +101,11 @@ var NetworkManager = (function NetworkManagerClosure() {
var useMozChunkedLoading = !!args.onProgressiveData;
if (useMozChunkedLoading) {
xhr.responseType = 'moz-chunked-arraybuffer';
xhr.responseType = "moz-chunked-arraybuffer";
pendingRequest.onProgressiveData = args.onProgressiveData;
pendingRequest.mozChunked = true;
} else {
xhr.responseType = 'arraybuffer';
xhr.responseType = "arraybuffer";
}
if (args.onError) {
@ -197,7 +197,7 @@ var NetworkManager = (function NetworkManagerClosure() {
var chunk = getArrayBuffer(xhr);
if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {
var rangeHeader = xhr.getResponseHeader('Content-Range');
var rangeHeader = xhr.getResponseHeader("Content-Range");
var matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader);
var begin = parseInt(matches[1], 10);
pendingRequest.onDone({