Fix inconsistent spacing and trailing commas in objects in remaining src/ files, so we can enable the comma-dangle and object-curly-spacing ESLint rules later on

http://eslint.org/docs/rules/comma-dangle
http://eslint.org/docs/rules/object-curly-spacing

Given that we currently have quite inconsistent object formatting, fixing this in *one* big patch probably wouldn't be feasible (since I cannot imagine anyone wanting to review that); hence I've opted to try and do this piecewise instead.

Please note: This patch was created automatically, using the ESLint `--fix` command line option. In a couple of places this caused lines to become too long, and I've fixed those manually; please refer to the interdiff below for the only hand-edits in this patch.

```diff
diff --git a/src/display/canvas.js b/src/display/canvas.js
index 5739f6f2..4216b2d2 100644
--- a/src/display/canvas.js
+++ b/src/display/canvas.js
@@ -2071,7 +2071,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
       var map = [];
       for (var i = 0, ii = positions.length; i < ii; i += 2) {
         map.push({ transform: [scaleX, 0, 0, scaleY, positions[i],
-                 positions[i + 1]], x: 0, y: 0, w: width, h: height, });
+                   positions[i + 1]], x: 0, y: 0, w: width, h: height, });
       }
       this.paintInlineImageXObjectGroup(imgData, map);
     },
diff --git a/src/display/svg.js b/src/display/svg.js
index 9eb05dfa..2aa21482 100644
--- a/src/display/svg.js
+++ b/src/display/svg.js
@@ -458,7 +458,11 @@ SVGGraphics = (function SVGGraphicsClosure() {

       for (var x = 0; x < fnArrayLen; x++) {
         var fnId = fnArray[x];
-        opList.push({ 'fnId': fnId, 'fn': REVOPS[fnId], 'args': argsArray[x], });
+        opList.push({
+          'fnId': fnId,
+          'fn': REVOPS[fnId],
+          'args': argsArray[x],
+        });
       }
       return opListToTree(opList);
     },
```
This commit is contained in:
Jonas Jenwald 2017-06-02 11:26:37 +02:00
parent 593dec1bb7
commit f20d2cd2ae
12 changed files with 144 additions and 140 deletions

View file

@ -176,7 +176,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
PDFJSDev.test('FIREFOX || MOZCENTRAL || GENERIC')) {
canvas.mozOpaque = true;
}
var ctx = canvas.getContext('2d', {alpha: false});
var ctx = canvas.getContext('2d', { alpha: false, });
var lastFontSize;
var lastFontFamily;
@ -293,7 +293,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
y2: box.bottom,
index: i,
x1New: undefined,
x2New: undefined
x2New: undefined,
};
});
expandBoundsLTR(width, bounds);
@ -304,7 +304,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
left: b.x1New,
top: 0,
right: b.x2New,
bottom: 0
bottom: 0,
};
});
@ -344,12 +344,12 @@ var renderTextLayer = (function renderTextLayerClosure() {
y2: Infinity,
index: -1,
x1New: 0,
x2New: 0
x2New: 0,
};
var horizon = [{
start: -Infinity,
end: Infinity,
boundary: fakeBoundary
boundary: fakeBoundary,
}];
bounds.forEach(function (boundary) {
@ -428,7 +428,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
changedHorizon.push({
start: horizonPart.start,
end: horizonPart.end,
boundary: useBoundary
boundary: useBoundary,
});
lastBoundary = useBoundary;
}
@ -438,7 +438,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
changedHorizon.unshift({
start: horizon[i].start,
end: boundary.y1,
boundary: horizon[i].boundary
boundary: horizon[i].boundary,
});
}
if (boundary.y2 < horizon[j].end) {
@ -446,7 +446,7 @@ var renderTextLayer = (function renderTextLayerClosure() {
changedHorizon.push({
start: boundary.y2,
end: horizon[j].end,
boundary: horizon[j].boundary
boundary: horizon[j].boundary,
});
}