// 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');
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];
}
constructor.prototype = {
- getIR: function RadialAxialShading_getIR() {
+ getIR: function radialAxialShadingsGetIR() {
var coordsArr = this.coordsArr;
var type = this.shadingType;
if (type == 2) {
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'];
}
};
* 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 = {};
/**
return this._data;
},
- onData: function(callback) {
+ onData: function promiseOnData(callback) {
if (this._data !== EMPTY_PROMISE) {
callback(this._data);
} else {
}
},
- resolve: function(data) {
+ resolve: function promiseResolve(data) {
if (this.isResolved) {
throw 'A Promise can be resolved only once ' + this.name;
}
}
},
- then: function(callback) {
+ then: function promiseThen(callback) {
if (!callback) {
throw 'Requiring callback' + this.name;
}