Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: ext/background.js

Issue 6528746257383424: Issue 1708 - Integrate first-run page changes in Chrome/Opera/Safari (Closed)
Patch Set: Rebased again Created Dec. 19, 2014, 3:45 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld