From 5376c8b4e1c5f1c5586ef2b70a3c2b711af017a6 Mon Sep 17 00:00:00 2001 From: Andreas Gal Date: Sun, 8 May 2011 14:26:08 -0700 Subject: [PATCH] use Object.create for Dict instead of a key prefix --- pdf.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pdf.js b/pdf.js index c7ca1f02c..a2f0fe317 100644 --- a/pdf.js +++ b/pdf.js @@ -126,17 +126,15 @@ var Cmd = (function() { var Dict = (function() { function constructor() { + this.map = Object.create(null); } constructor.prototype = { get: function(key) { - return this["$" + key]; + return this.map[key]; }, set: function(key, value) { - this["$" + key] = value; - }, - contains: function(key) { - return ("$" + key) in this; + this.map[key] = value; } };