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;

View file

@ -39,7 +39,7 @@ var CustomStyle = (function CustomStyleClosure() {
// in some versions of IE9 it is critical that ms appear in this list
// before Moz
var prefixes = ['ms', 'Moz', 'Webkit', 'O'];
var _cache = {};
var _cache = Object.create(null);
function CustomStyle() {}

View file

@ -340,7 +340,7 @@ Object.defineProperty(FontLoader, 'isSyncFontLoadingSupported', {
var FontFaceObject = (function FontFaceObjectClosure() {
function FontFaceObject(translatedData) {
this.compiledGlyphs = {};
this.compiledGlyphs = Object.create(null);
// importing translated data
for (var i in translatedData) {
this[i] = translatedData[i];

View file

@ -58,7 +58,7 @@ var Metadata = PDFJS.Metadata = (function MetadataClosure() {
}
this.metaDocument = meta;
this.metadata = {};
this.metadata = Object.create(null);
this.parse();
}

View file

@ -385,7 +385,7 @@ var SVGGraphics = (function SVGGraphicsClosure() {
this.pendingEOFill = false;
this.embedFonts = false;
this.embeddedFonts = {};
this.embeddedFonts = Object.create(null);
this.cssStyle = null;
}