'use strict';
-var Name = (function nameName() {
- function constructor(name) {
+var Name = (function NameClosure() {
+ function Name(name) {
this.name = name;
}
- constructor.prototype = {
+ Name.prototype = {
};
- return constructor;
+ return Name;
})();
-var Cmd = (function cmdCmd() {
- function constructor(cmd) {
+var Cmd = (function CmdClosure() {
+ function Cmd(cmd) {
this.cmd = cmd;
}
- constructor.prototype = {
+ Cmd.prototype = {
};
- return constructor;
+ return Cmd;
})();
-var Dict = (function dictDict() {
- function constructor() {
+var Dict = (function DictClosure() {
+ function Dict() {
this.map = Object.create(null);
}
- constructor.prototype = {
+ Dict.prototype = {
get: function dictGet(key1, key2, key3) {
var value;
if (typeof (value = this.map[key1]) != 'undefined' || key1 in this.map ||
}
};
- return constructor;
+ return Dict;
})();
-var Ref = (function refRef() {
- function constructor(num, gen) {
+var Ref = (function RefClosure() {
+ function Ref(num, gen) {
this.num = num;
this.gen = gen;
}
- constructor.prototype = {
+ Ref.prototype = {
};
- return constructor;
+ return Ref;
})();
// The reference is identified by number and generation,
// this structure stores only one instance of the reference.
-var RefSet = (function refSet() {
- function constructor() {
+var RefSet = (function RefSetClosure() {
+ function RefSet() {
this.dict = {};
}
- constructor.prototype = {
+ RefSet.prototype = {
has: function refSetHas(ref) {
return !!this.dict['R' + ref.num + '.' + ref.gen];
},
}
};
- return constructor;
+ return RefSet;
})();
-var Catalog = (function catalogCatalog() {
- function constructor(xref) {
+var Catalog = (function CatalogClosure() {
+ function Catalog(xref) {
this.xref = xref;
var obj = xref.getCatalogObj();
assertWellFormed(isDict(obj), 'catalog object is not a dictionary');
this.catDict = obj;
}
- constructor.prototype = {
+ Catalog.prototype = {
get toplevelPagesDict() {
var pagesObj = this.catDict.get('Pages');
assertWellFormed(isRef(pagesObj), 'invalid top-level pages reference');
}
};
- return constructor;
+ return Catalog;
})();
-var XRef = (function xRefXRef() {
- function constructor(stream, startXRef, mainXRefEntriesOffset) {
+var XRef = (function XRefClosure() {
+ function XRef(stream, startXRef, mainXRefEntriesOffset) {
this.stream = stream;
this.entries = [];
this.xrefstms = {};
error('Invalid root reference');
}
- constructor.prototype = {
+ XRef.prototype = {
readXRefTable: function readXRefTable(parser) {
var obj;
while (true) {
}
};
- return constructor;
+ return XRef;
})();
/**
* inside of a worker. The `PDFObjects` implements some basic functions to
* manage these objects.
*/
-var PDFObjects = (function pdfObjects() {
+var PDFObjects = (function PDFObjectsClosure() {
function PDFObjects() {
this.objs = {};
}