mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Merge pull request #6915 from yurydelendik/lookuptables
Refactor lookup hash tables/objects
This commit is contained in:
commit
825a2225ab
23 changed files with 9970 additions and 9667 deletions
|
@ -362,6 +362,18 @@ function shadow(obj, prop, value) {
|
|||
}
|
||||
PDFJS.shadow = shadow;
|
||||
|
||||
function getLookupTableFactory(initializer) {
|
||||
var lookup;
|
||||
return function () {
|
||||
if (initializer) {
|
||||
lookup = Object.create(null);
|
||||
initializer(lookup);
|
||||
initializer = null;
|
||||
}
|
||||
return lookup;
|
||||
};
|
||||
}
|
||||
|
||||
var LinkTarget = PDFJS.LinkTarget = {
|
||||
NONE: 0, // Default value.
|
||||
SELF: 1,
|
||||
|
@ -1469,7 +1481,7 @@ var StatTimer = (function StatTimerClosure() {
|
|||
return str;
|
||||
}
|
||||
function StatTimer() {
|
||||
this.started = {};
|
||||
this.started = Object.create(null);
|
||||
this.times = [];
|
||||
this.enabled = true;
|
||||
}
|
||||
|
@ -1563,8 +1575,8 @@ function MessageHandler(sourceName, targetName, comObj) {
|
|||
this.comObj = comObj;
|
||||
this.callbackIndex = 1;
|
||||
this.postMessageTransfers = true;
|
||||
var callbacksCapabilities = this.callbacksCapabilities = {};
|
||||
var ah = this.actionHandler = {};
|
||||
var callbacksCapabilities = this.callbacksCapabilities = Object.create(null);
|
||||
var ah = this.actionHandler = Object.create(null);
|
||||
|
||||
this._onComObjOnMessage = function messageHandlerComObjOnMessage(event) {
|
||||
var data = event.data;
|
||||
|
@ -2355,6 +2367,7 @@ exports.combineUrl = combineUrl;
|
|||
exports.createPromiseCapability = createPromiseCapability;
|
||||
exports.deprecated = deprecated;
|
||||
exports.error = error;
|
||||
exports.getLookupTableFactory = getLookupTableFactory;
|
||||
exports.info = info;
|
||||
exports.isArray = isArray;
|
||||
exports.isArrayBuffer = isArrayBuffer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue