Replaces literal {} created lookup tables with Object.create

This commit is contained in:
Yury Delendik 2016-01-27 11:04:13 -06:00
parent d6adf84159
commit 2edf2792dc
18 changed files with 106 additions and 104 deletions

View file

@ -873,7 +873,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
this.objs = new PDFObjects();
this.cleanupAfterRender = false;
this.pendingCleanup = false;
this.intentStates = {};
this.intentStates = Object.create(null);
this.destroyed = false;
}
PDFPageProxy.prototype = /** @lends PDFPageProxy.prototype */ {
@ -948,7 +948,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
var renderingIntent = (params.intent === 'print' ? 'print' : 'display');
if (!this.intentStates[renderingIntent]) {
this.intentStates[renderingIntent] = {};
this.intentStates[renderingIntent] = Object.create(null);
}
var intentState = this.intentStates[renderingIntent];
@ -1040,7 +1040,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() {
var renderingIntent = 'oplist';
if (!this.intentStates[renderingIntent]) {
this.intentStates[renderingIntent] = {};
this.intentStates[renderingIntent] = Object.create(null);
}
var intentState = this.intentStates[renderingIntent];
@ -1871,7 +1871,7 @@ var WorkerTransport = (function WorkerTransportClosure() {
*/
var PDFObjects = (function PDFObjectsClosure() {
function PDFObjects() {
this.objs = {};
this.objs = Object.create(null);
}
PDFObjects.prototype = {
@ -1962,7 +1962,7 @@ var PDFObjects = (function PDFObjectsClosure() {
},
clear: function PDFObjects_clear() {
this.objs = {};
this.objs = Object.create(null);
}
};
return PDFObjects;