Name constructors in obj.js.

This commit is contained in:
Kalervo Kujala 2011-12-07 00:18:40 +02:00
parent 9eae90a1ba
commit f239d01bde

View File

@ -3,34 +3,34 @@
'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 ||
@ -60,29 +60,29 @@ var Dict = (function dictDict() {
}
};
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];
},
@ -92,18 +92,18 @@ var RefSet = (function refSet() {
}
};
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');
@ -253,11 +253,11 @@ var Catalog = (function catalogCatalog() {
}
};
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 = {};
@ -278,7 +278,7 @@ var XRef = (function xRefXRef() {
error('Invalid root reference');
}
constructor.prototype = {
XRef.prototype = {
readXRefTable: function readXRefTable(parser) {
var obj;
while (true) {
@ -642,7 +642,7 @@ var XRef = (function xRefXRef() {
}
};
return constructor;
return XRef;
})();
/**
@ -651,7 +651,7 @@ var XRef = (function xRefXRef() {
* 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 = {};
}