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

Unified Diff: lib/elemHide.js

Issue 5636077285015552: Issue 656 - Replace some __proto__ with Object.create (Closed)
Patch Set: Created June 23, 2014, 8:46 a.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
« no previous file with comments | « chrome/content/ui/sidebar.js ('k') | lib/filterClasses.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/elemHide.js
===================================================================
--- a/lib/elemHide.js
+++ b/lib/elemHide.js
@@ -28,35 +28,35 @@ let {ElemHideException} = require("filte
let {FilterNotifier} = require("filterNotifier");
let {AboutHandler} = require("elemHideHitRegistration");
let {TimeLine} = require("timeline");
/**
* Lookup table, filters by their associated key
* @type Object
*/
-let filterByKey = {__proto__: null};
+let filterByKey = Object.create(null);
/**
* Lookup table, keys of the filters by filter text
* @type Object
*/
-let keyByFilter = {__proto__: null};
+let keyByFilter = Object.create(null);
/**
* Lookup table, keys are known element hiding exceptions
* @type Object
*/
-let knownExceptions = {__proto__: null};
+let knownExceptions = Object.create(null);
/**
* Lookup table, lists of element hiding exceptions by selector
* @type Object
*/
-let exceptions = {__proto__: null};
+let exceptions = Object.create(null);
/**
* Currently applied stylesheet URL
* @type nsIURI
*/
let styleURL = null;
/**
@@ -103,20 +103,20 @@ let ElemHide = exports.ElemHide =
TimeLine.leave("ElemHide.init() done");
},
/**
* Removes all known filters
*/
clear: function()
{
- filterByKey = {__proto__: null};
- keyByFilter = {__proto__: null};
- knownExceptions = {__proto__: null};
- exceptions = {__proto__: null};
+ filterByKey = Object.create(null);
+ keyByFilter = Object.create(null);
+ knownExceptions = Object.create(null);
+ exceptions = Object.create(null);
ElemHide.isDirty = false;
ElemHide.unapply();
},
/**
* Add a new element hiding filter
* @param {ElemHideFilter} filter
*/
@@ -300,29 +300,29 @@ let ElemHide = exports.ElemHide =
TimeLine.leave("ElemHide.apply() done", "ElemHideWrite");
},
_generateCSSContent: function()
{
// Grouping selectors by domains
TimeLine.log("start grouping selectors");
- let domains = {__proto__: null};
+ let domains = Object.create(null);
let hasFilters = false;
for (let key in filterByKey)
{
let filter = filterByKey[key];
let domain = filter.selectorDomain || "";
let list;
if (domain in domains)
list = domains[domain];
else
{
- list = {__proto__: null};
+ list = Object.create(null);
domains[domain] = list;
}
list[filter.selector] = key;
hasFilters = true;
}
TimeLine.log("done grouping selectors");
if (!hasFilters)
« no previous file with comments | « chrome/content/ui/sidebar.js ('k') | lib/filterClasses.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld