]> git.parisson.com Git - pdf.js.git/commitdiff
use Object.create for Dict instead of a key prefix
authorAndreas Gal <andreas.gal@gmail.com>
Sun, 8 May 2011 21:26:08 +0000 (14:26 -0700)
committerAndreas Gal <andreas.gal@gmail.com>
Sun, 8 May 2011 21:26:08 +0000 (14:26 -0700)
pdf.js

diff --git a/pdf.js b/pdf.js
index c7ca1f02c9f8998a6b880c413254a4e0c265770b..a2f0fe317cbb949946baf5ba37a89a831bfe6048 100644 (file)
--- 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;
         }
     };