Index: ext/background.js |
=================================================================== |
--- a/ext/background.js |
+++ b/ext/background.js |
@@ -17,27 +17,31 @@ |
(function() |
{ |
var nonEmptyPageMaps = {__proto__: null}; |
var pageMapCounter = 0; |
var PageMap = ext.PageMap = function() |
{ |
- this._map = {__proto__: null}; |
+ this._map = Object.create(null); |
this._id = ++pageMapCounter; |
}; |
PageMap.prototype = { |
_delete: function(id) |
{ |
delete this._map[id]; |
if (Object.keys(this._map).length == 0) |
delete nonEmptyPageMaps[this._id]; |
}, |
+ keys: function() |
+ { |
+ return Object.keys(this._map).map(ext._getPage); |
+ }, |
get: function(page) |
{ |
return this._map[page._id]; |
}, |
set: function(page, value) |
{ |
this._map[page._id] = value; |
nonEmptyPageMaps[this._id] = this; |