Skip to content

Commit 03c779a

Browse files
committed
Merge pull request mozilla#733 from kkujala/dev
Name anonymous functions
2 parents 0538edb + a7690de commit 03c779a

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

src/canvas.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -541,8 +541,7 @@ var CanvasGraphics = (function canvasGraphics() {
541541
},
542542

543543
// Color
544-
setStrokeColorSpace:
545-
function canvasGraphicsSetStrokeColorSpacefunction(raw) {
544+
setStrokeColorSpace: function canvasGraphicsSetStrokeColorSpace(raw) {
546545
this.current.strokeColorSpace = ColorSpace.fromIR(raw);
547546
},
548547
setFillColorSpace: function canvasGraphicsSetFillColorSpace(raw) {
@@ -553,7 +552,7 @@ var CanvasGraphics = (function canvasGraphics() {
553552
var color = cs.getRgb(arguments);
554553
this.setStrokeRGBColor.apply(this, color);
555554
},
556-
getColorN_IR_Pattern: function(IR, cs) {
555+
getColorN_IR_Pattern: function canvasGraphicsGetColorN_IR_Pattern(IR, cs) {
557556
if (IR[0] == 'TilingPattern') {
558557
var args = IR[1];
559558
var base = cs.base;
@@ -669,8 +668,8 @@ var CanvasGraphics = (function canvasGraphics() {
669668
error('Should not call beginImageData');
670669
},
671670

672-
paintFormXObjectBegin:
673-
function canvasGraphicsPaintFormXObject(matrix, bbox) {
671+
paintFormXObjectBegin: function canvasGraphicsPaintFormXObjectBegin(matrix,
672+
bbox) {
674673
this.save();
675674

676675
if (matrix && isArray(matrix) && 6 == matrix.length)
@@ -685,11 +684,11 @@ var CanvasGraphics = (function canvasGraphics() {
685684
}
686685
},
687686

688-
paintFormXObjectEnd: function() {
687+
paintFormXObjectEnd: function canvasGraphicsPaintFormXObjectEnd() {
689688
this.restore();
690689
},
691690

692-
paintJpegXObject: function(objId, w, h) {
691+
paintJpegXObject: function canvasGraphicsPaintJpegXObject(objId, w, h) {
693692
var image = this.objs.get(objId);
694693
if (!image) {
695694
error('Dependent image isn\'t ready yet');
@@ -708,7 +707,8 @@ var CanvasGraphics = (function canvasGraphics() {
708707
this.restore();
709708
},
710709

711-
paintImageMaskXObject: function(imgArray, inverseDecode, width, height) {
710+
paintImageMaskXObject: function canvasGraphicsPaintImageMaskXObject(
711+
imgArray, inverseDecode, width, height) {
712712
function applyStencilMask(buffer, inverseDecode) {
713713
var imgArrayPos = 0;
714714
var i, j, mask, buf;
@@ -756,7 +756,7 @@ var CanvasGraphics = (function canvasGraphics() {
756756
this.restore();
757757
},
758758

759-
paintImageXObject: function(imgData) {
759+
paintImageXObject: function canvasGraphicsPaintImageXObject(imgData) {
760760
this.save();
761761
var ctx = this.ctx;
762762
var w = imgData.width;

src/colorspace.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ var ColorSpace = (function colorSpaceColorSpace() {
1212
constructor.prototype = {
1313
// Input: array of size numComps representing color component values
1414
// Output: array of rgb values, each value ranging from [0.1]
15-
getRgb: function cs_getRgb(color) {
15+
getRgb: function colorSpaceGetRgb(color) {
1616
error('Should not call ColorSpace.getRgb: ' + color);
1717
},
1818
// Input: Uint8Array of component values, each value scaled to [0,255]
1919
// Output: Uint8Array of rgb values, each value scaled to [0,255]
20-
getRgbBuffer: function cs_getRgbBuffer(input) {
20+
getRgbBuffer: function colorSpaceGetRgbBuffer(input) {
2121
error('Should not call ColorSpace.getRgbBuffer: ' + input);
2222
}
2323
};
2424

25-
constructor.parse = function colorspace_parse(cs, xref, res) {
25+
constructor.parse = function colorSpaceParse(cs, xref, res) {
2626
var IR = constructor.parseToIR(cs, xref, res, true);
2727
if (IR instanceof SeparationCS)
2828
return IR;
2929

3030
return constructor.fromIR(IR);
3131
};
3232

33-
constructor.fromIR = function(IR) {
33+
constructor.fromIR = function colorSpaceFromIR(IR) {
3434
var name;
3535
if (isArray(IR)) {
3636
name = IR[0];
@@ -71,7 +71,8 @@ var ColorSpace = (function colorSpaceColorSpace() {
7171
return null;
7272
}
7373

74-
constructor.parseToIR = function colorspace_parse(cs, xref, res, parseOnly) {
74+
constructor.parseToIR = function colorSpaceParseToIR(cs, xref, res,
75+
parseOnly) {
7576
if (isName(cs)) {
7677
var colorSpaces = xref.fetchIfRef(res.get('ColorSpace'));
7778
if (isDict(colorSpaces)) {

src/image.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ var PDFImage = (function pdfImage() {
229229
return constructor;
230230
})();
231231

232-
var JpegImage = (function() {
232+
var JpegImage = (function jpegImage() {
233233
function JpegImage(objId, imageData, objs) {
234234
var src = 'data:image/jpeg;base64,' + window.btoa(imageData);
235235

236236
var img = new Image();
237-
img.onload = (function() {
237+
img.onload = (function jpegImageOnload() {
238238
this.loaded = true;
239239

240240
objs.resolve(objId, this);
@@ -247,7 +247,7 @@ var JpegImage = (function() {
247247
}
248248

249249
JpegImage.prototype = {
250-
getImage: function() {
250+
getImage: function jpegImageGetImage() {
251251
return this.domImage;
252252
}
253253
};

0 commit comments

Comments
 (0)