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); |
Sebastian Noack
2014/12/19 17:57:53
Is that an unrelated change in a line you wouldn't
Wladimir Palant
2014/12/19 19:38:42
Yes, it's an unrelated change - I simply fixed thi
|
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; |