]> git.parisson.com Git - pdf.js.git/commitdiff
Name a few anonymous functions.
authorKalervo Kujala <kkujala@com>
Sat, 29 Oct 2011 10:20:48 +0000 (13:20 +0300)
committerKalervo Kujala <kkujala@com>
Sat, 29 Oct 2011 10:20:48 +0000 (13:20 +0300)
Also rename some functions.

src/pattern.js
src/stream.js
src/util.js

index 8e7760e51905595419227500594d32f25e057acb..2539a288e6694b7019918f187110b0376b43a44c 100644 (file)
@@ -43,7 +43,7 @@ var Shadings = {};
 
 // Radial and axial shading have very similar implementations
 // If needed, the implementations can be broken into two classes
-Shadings.RadialAxial = (function radialAxialShading() {
+Shadings.RadialAxial = (function radialAxialShadings() {
   function constructor(dict, matrix, xref, res, ctx) {
     this.matrix = matrix;
     this.coordsArr = dict.get('Coords');
@@ -97,7 +97,7 @@ Shadings.RadialAxial = (function radialAxialShading() {
     this.colorStops = colorStops;
   }
 
-  constructor.fromIR = function(ctx, raw) {
+  constructor.fromIR = function radialAxialShadingsGetIR(ctx, raw) {
     var type = raw[1];
     var colorStops = raw[2];
     var p0 = raw[3];
@@ -129,7 +129,7 @@ Shadings.RadialAxial = (function radialAxialShading() {
   }
 
   constructor.prototype = {
-    getIR: function RadialAxialShading_getIR() {
+    getIR: function radialAxialShadingsGetIR() {
       var coordsArr = this.coordsArr;
       var type = this.shadingType;
       if (type == 2) {
@@ -159,17 +159,17 @@ Shadings.RadialAxial = (function radialAxialShading() {
   return constructor;
 })();
 
-Shadings.Dummy = (function dummyShading() {
+Shadings.Dummy = (function dummyShadings() {
   function constructor() {
     this.type = 'Pattern';
   }
 
-  constructor.fromIR = function() {
+  constructor.fromIR = function dummyShadingsFromIR() {
     return 'hotpink';
   }
 
   constructor.prototype = {
-    getIR: function dummpy_getir() {
+    getIR: function dummyShadingsGetIR() {
       return ['Dummy'];
     }
   };
index 2b10e2fbd642db9b78fedefaaedcb567744b4b40..73b096f1e69f72078030abc9d3091565af265903 100644 (file)
@@ -801,7 +801,7 @@ var JpegStream = (function jpegStream() {
   }
 
   constructor.prototype = {
-    getIR: function() {
+    getIR: function jpegStreamGetIR() {
       return this.src;
     },
     getChar: function jpegStreamGetChar() {
index 9765914ca2f88755d65ea3f7e591b673948c50d2..41ae4cc96877d1c0e8022954322ed88a585a8763 100644 (file)
@@ -197,7 +197,7 @@ function isPDFFunction(v) {
  * can be set. If any of these happens twice or the data is required before
  * it was set, an exception is throw.
  */
-var Promise = (function() {
+var Promise = (function promise() {
   var EMPTY_PROMISE = {};
 
   /**
@@ -244,7 +244,7 @@ var Promise = (function() {
       return this._data;
     },
 
-    onData: function(callback) {
+    onData: function promiseOnData(callback) {
       if (this._data !== EMPTY_PROMISE) {
         callback(this._data);
       } else {
@@ -252,7 +252,7 @@ var Promise = (function() {
       }
     },
 
-    resolve: function(data) {
+    resolve: function promiseResolve(data) {
       if (this.isResolved) {
         throw 'A Promise can be resolved only once ' + this.name;
       }
@@ -266,7 +266,7 @@ var Promise = (function() {
       }
     },
 
-    then: function(callback) {
+    then: function promiseThen(callback) {
       if (!callback) {
         throw 'Requiring callback' + this.name;
       }