* inside of a worker. The `PDFObjects` implements some basic functions to
* manage these objects.
*/
-var PDFObjects = (function() {
+var PDFObjects = (function pdfObjects() {
function PDFObjects() {
this.objs = {};
}
* Ensures there is an object defined for `objId`. Stores `data` on the
* object *if* it is created.
*/
- ensureObj: function(objId, data) {
+ ensureObj: function pdfObjectsEnsureObj(objId, data) {
if (this.objs[objId])
return this.objs[objId];
return this.objs[objId] = new Promise(objId, data);
* function and the object is already resolved, the callback gets called
* right away.
*/
- get: function(objId, callback) {
+ get: function pdfObjectsGet(objId, callback) {
// If there is a callback, then the get can be async and the object is
// not required to be resolved right now
if (callback) {
/**
* Resolves the object `objId` with optional `data`.
*/
- resolve: function(objId, data) {
+ resolve: function pdfObjectsResolve(objId, data) {
var objs = this.objs;
// In case there is a promise already on this object, just resolve it.
}
},
- onData: function(objId, callback) {
+ onData: function pdfObjectsOnData(objId, callback) {
this.ensureObj(objId).onData(callback);
},
- isResolved: function(objId) {
+ isResolved: function pdfObjectsIsResolved(objId) {
var objs = this.objs;
if (!objs[objId]) {
return false;
}
},
- hasData: function(objId) {
+ hasData: function pdfObjectsHasData(objId) {
var objs = this.objs;
if (!objs[objId]) {
return false;
/**
* Sets the data of an object but *doesn't* resolve it.
*/
- setData: function(objId, data) {
+ setData: function pdfObjectsSetData(objId, data) {
// Watchout! If you call `this.ensureObj(objId, data)` you're going to
// create a *resolved* promise which shouldn't be the case!
this.ensureObj(objId).data = data;