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

@ -98,7 +98,9 @@ if (typeof PDFJSDev === 'undefined' ||
return (typeof imageData.data.buffer !== 'undefined');
};
} else {
hasCanvasTypedArrays = function () { return true; };
hasCanvasTypedArrays = function () {
return true;
};
}
var LinkTarget = {

View file

@ -68,8 +68,12 @@
}
delete PDFJS.verbosity;
Object.defineProperty(PDFJS, 'verbosity', {
get: function () { return sharedUtil.getVerbosityLevel(); },
set: function (level) { sharedUtil.setVerbosityLevel(level); },
get: function () {
return sharedUtil.getVerbosityLevel();
},
set: function (level) {
sharedUtil.setVerbosityLevel(level);
},
enumerable: true,
configurable: true
});

View file

@ -347,7 +347,9 @@ var renderTextLayer = (function renderTextLayerClosure() {
function expandBoundsLTR(width, bounds) {
// Sorting by x1 coordinate and walk by the bounds in the same order.
bounds.sort(function (a, b) { return a.x1 - b.x1 || a.index - b.index; });
bounds.sort(function (a, b) {
return a.x1 - b.x1 || a.index - b.index;
});
// First we see on the horizon is a fake boundary.
var fakeBoundary = {