Enable the object-shorthand ESLint rule in src/shared

Please see http://eslint.org/docs/rules/object-shorthand.

For the most part, these changes are of the search-and-replace kind, and the previously enabled `no-undef` rule should complement the tests in helping ensure that no stupid errors crept into to the patch.
This commit is contained in:
Jonas Jenwald 2017-04-27 12:58:44 +02:00
parent f91d01cad3
commit afc74b0178
22 changed files with 195 additions and 198 deletions

View file

@ -237,7 +237,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
repeat += code[i++];
}
while (repeat-- > 0) {
points.push({flags: flags});
points.push({ flags, });
}
}
for (j = 0; j < numberOfPoints; j++) {
@ -617,7 +617,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
this.fontMatrix = fontMatrix;
}
CompiledFont.prototype = {
getPathJs: function (unicode) {
getPathJs(unicode) {
var cmap = lookupCmap(this.cmap, unicode);
var fn = this.compiledGlyphs[cmap.glyphId];
if (!fn) {
@ -630,7 +630,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
return fn;
},
compileGlyph: function (code) {
compileGlyph(code) {
if (!code || code.length === 0 || code[0] === 14) {
return noop;
}
@ -647,11 +647,11 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
return cmds;
},
compileGlyphImpl: function () {
compileGlyphImpl() {
error('Children classes should implement this.');
},
hasBuiltPath: function (unicode) {
hasBuiltPath(unicode) {
var cmap = lookupCmap(this.cmap, unicode);
return (this.compiledGlyphs[cmap.glyphId] !== undefined &&
this.compiledCharCodeToGlyphId[cmap.charCode] !== undefined);
@ -667,7 +667,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
}
Util.inherit(TrueTypeCompiled, CompiledFont, {
compileGlyphImpl: function (code, cmds) {
compileGlyphImpl(code, cmds) {
compileGlyf(code, cmds, this);
}
});
@ -689,7 +689,7 @@ var FontRendererFactory = (function FontRendererFactoryClosure() {
}
Util.inherit(Type2Compiled, CompiledFont, {
compileGlyphImpl: function (code, cmds) {
compileGlyphImpl(code, cmds) {
compileCharString(code, cmds, this);
}
});