mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 09:45:42 +02:00
Replaces literal {} created lookup tables with Object.create
This commit is contained in:
parent
d6adf84159
commit
2edf2792dc
18 changed files with 106 additions and 104 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue