mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Fix inconsistent spacing and trailing commas in objects in src/core/
files, so we can enable the comma-dangle
and object-curly-spacing
ESLint rules later on
*Unfortunately this patch is fairly big, even though it only covers the `src/core` folder, but splitting it even further seemed difficult.* 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/core/evaluator.js b/src/core/evaluator.js index abab9027..dcd3594b 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -2785,7 +2785,8 @@ var EvaluatorPreprocessor = (function EvaluatorPreprocessorClosure() { t['Tz'] = { id: OPS.setHScale, numArgs: 1, variableArgs: false, }; t['TL'] = { id: OPS.setLeading, numArgs: 1, variableArgs: false, }; t['Tf'] = { id: OPS.setFont, numArgs: 2, variableArgs: false, }; - t['Tr'] = { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false, }; + t['Tr'] = { id: OPS.setTextRenderingMode, numArgs: 1, + variableArgs: false, }; t['Ts'] = { id: OPS.setTextRise, numArgs: 1, variableArgs: false, }; t['Td'] = { id: OPS.moveText, numArgs: 2, variableArgs: false, }; t['TD'] = { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false, }; diff --git a/src/core/jbig2.js b/src/core/jbig2.js index 5a17d482..71671541 100644 --- a/src/core/jbig2.js +++ b/src/core/jbig2.js @@ -123,19 +123,22 @@ var Jbig2Image = (function Jbig2ImageClosure() { { x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, { x: -2, y: 0, }, { x: -1, y: 0, }], [{ x: -3, y: -1, }, { x: -2, y: -1, }, { x: -1, y: -1, }, { x: 0, y: -1, }, - { x: 1, y: -1, }, { x: -4, y: 0, }, { x: -3, y: 0, }, { x: -2, y: 0, }, { x: -1, y: 0, }] + { x: 1, y: -1, }, { x: -4, y: 0, }, { x: -3, y: 0, }, { x: -2, y: 0, }, + { x: -1, y: 0, }] ]; var RefinementTemplates = [ { coding: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }], - reference: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }, { x: 0, y: 0, }, - { x: 1, y: 0, }, { x: -1, y: 1, }, { x: 0, y: 1, }, { x: 1, y: 1, }], + reference: [{ x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }, + { x: 0, y: 0, }, { x: 1, y: 0, }, { x: -1, y: 1, }, + { x: 0, y: 1, }, { x: 1, y: 1, }], }, { - coding: [{ x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, { x: -1, y: 0, }], - reference: [{ x: 0, y: -1, }, { x: -1, y: 0, }, { x: 0, y: 0, }, { x: 1, y: 0, }, - { x: 0, y: 1, }, { x: 1, y: 1, }], + coding: [{ x: -1, y: -1, }, { x: 0, y: -1, }, { x: 1, y: -1, }, + { x: -1, y: 0, }], + reference: [{ x: 0, y: -1, }, { x: -1, y: 0, }, { x: 0, y: 0, }, + { x: 1, y: 0, }, { x: 0, y: 1, }, { x: 1, y: 1, }], } ]; ```
This commit is contained in:
parent
593dec1bb7
commit
a8c87f8019
29 changed files with 586 additions and 582 deletions
|
@ -28,7 +28,7 @@ var ShadingType = {
|
|||
FREE_FORM_MESH: 4,
|
||||
LATTICE_FORM_MESH: 5,
|
||||
COONS_PATCH_MESH: 6,
|
||||
TENSOR_PATCH_MESH: 7
|
||||
TENSOR_PATCH_MESH: 7,
|
||||
};
|
||||
|
||||
var Pattern = (function PatternClosure() {
|
||||
|
@ -42,7 +42,7 @@ var Pattern = (function PatternClosure() {
|
|||
// Output: the appropriate fillStyle or strokeStyle
|
||||
getPattern: function Pattern_getPattern(ctx) {
|
||||
error('Should not call Pattern.getStyle: ' + ctx);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Pattern.parseShading = function Pattern_parseShading(shading, matrix, xref,
|
||||
|
@ -70,7 +70,7 @@ var Pattern = (function PatternClosure() {
|
|||
throw ex;
|
||||
}
|
||||
handler.send('UnsupportedFeature',
|
||||
{featureId: UNSUPPORTED_FEATURES.shadingPattern});
|
||||
{ featureId: UNSUPPORTED_FEATURES.shadingPattern, });
|
||||
warn(ex);
|
||||
return new Shadings.Dummy();
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ Shadings.RadialAxial = (function RadialAxialClosure() {
|
|||
}
|
||||
|
||||
return ['RadialAxial', type, this.colorStops, p0, p1, r0, r1];
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return RadialAxial;
|
||||
|
@ -313,7 +313,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
this.context.colorFn(components, 0, color, 0);
|
||||
}
|
||||
return this.context.colorSpace.getRgb(color, 0);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
function decodeType4Shading(mesh, reader) {
|
||||
|
@ -589,7 +589,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
mesh.figures.push({
|
||||
type: 'patch',
|
||||
coords: new Int32Array(ps), // making copies of ps and cs
|
||||
colors: new Int32Array(cs)
|
||||
colors: new Int32Array(cs),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -654,7 +654,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
mesh.figures.push({
|
||||
type: 'patch',
|
||||
coords: new Int32Array(ps), // making copies of ps and cs
|
||||
colors: new Int32Array(cs)
|
||||
colors: new Int32Array(cs),
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -731,7 +731,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
decode: dict.getArray('Decode'),
|
||||
colorFn: fn,
|
||||
colorSpace: cs,
|
||||
numComps: fn ? 1 : cs.numComps
|
||||
numComps: fn ? 1 : cs.numComps,
|
||||
};
|
||||
var reader = new MeshStreamReader(stream, decodeContext);
|
||||
|
||||
|
@ -775,7 +775,7 @@ Shadings.Mesh = (function MeshClosure() {
|
|||
getIR: function Mesh_getIR() {
|
||||
return ['Mesh', this.shadingType, this.coords, this.colors, this.figures,
|
||||
this.bounds, this.matrix, this.bbox, this.background];
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
return Mesh;
|
||||
|
@ -789,7 +789,7 @@ Shadings.Dummy = (function DummyClosure() {
|
|||
Dummy.prototype = {
|
||||
getIR: function Dummy_getIR() {
|
||||
return ['Dummy'];
|
||||
}
|
||||
},
|
||||
};
|
||||
return Dummy;
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue