1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Adjust the brace-style ESLint rule to disallow single lines (and also enable no-iterator)

See http://eslint.org/docs/rules/brace-style.
Having the opening/closing braces on the same line can often make the code slightly more difficult to read, in particular for `if`/`else if` statements, compared to using new lines.

This patch also, for consistency with `mozilla-central`, enables the [`no-iterator`](http://eslint.org/docs/rules/no-iterator) rule. Note that this rule didn't require a single code change.
This commit is contained in:
Jonas Jenwald 2017-02-03 12:58:08 +01:00
parent 92e5fb099e
commit bc736fdc7d
18 changed files with 129 additions and 46 deletions

View file

@ -94,7 +94,9 @@ IPDFStream.prototype = {
* Gets a reader for the entire PDF data.
* @returns {IPDFStreamReader}
*/
getFullReader: function () { return null; },
getFullReader: function () {
return null;
},
/**
* Gets a reader for the range of the PDF data.
@ -102,7 +104,9 @@ IPDFStream.prototype = {
* @param {number} end - the end offset of the data.
* @returns {IPDFStreamRangeReader}
*/
getRangeReader: function (begin, end) { return null; },
getRangeReader: function (begin, end) {
return null;
},
/**
* Cancels all opened reader and closes all their opened requests.
@ -123,14 +127,18 @@ IPDFStreamReader.prototype = {
* the PDF data stream are available.
* @returns {Promise}
*/
get headersReady() { return null; },
get headersReady() {
return null;
},
/**
* Gets PDF binary data length. It is defined after the headersReady promise
* is resolved.
* @returns {number} The data length (or 0 if unknown).
*/
get contentLength() { return 0; },
get contentLength() {
return 0;
},
/**
* Gets ability of the stream to handle range requests. It is defined after
@ -138,14 +146,18 @@ IPDFStreamReader.prototype = {
* or an error occurs.
* @returns {boolean}
*/
get isRangeSupported() { return false; },
get isRangeSupported() {
return false;
},
/**
* Gets ability of the stream to progressively load binary data. It is defined
* after the headersReady promise is resolved.
* @returns {boolean}
*/
get isStreamingSupported() { return false; },
get isStreamingSupported() {
return false;
},
/**
* Requests a chunk of the binary data. The method returns the promise, which
@ -183,7 +195,9 @@ IPDFStreamRangeReader.prototype = {
* Gets ability of the stream to progressively load binary data.
* @returns {boolean}
*/
get isStreamingSupported() { return false; },
get isStreamingSupported() {
return false;
},
/**
* Requests a chunk of the binary data. The method returns the promise, which