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

Unified Diff: chrome/content/ui/sendReport.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/filters-subscriptionview.js ('k') | chrome/content/ui/sidebar.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/content/ui/sendReport.js
===================================================================
--- a/chrome/content/ui/sendReport.js
+++ b/chrome/content/ui/sendReport.js
@@ -184,17 +184,17 @@ let reportsListDataSource =
};
let requestsDataSource =
{
requests: reportElement("requests"),
origRequests: [],
requestNotifier: null,
callback: null,
- nodeByKey: {__proto__: null},
+ nodeByKey: Object.create(null),
collectData: function(wnd, windowURI, callback)
{
this.callback = callback;
this.requestNotifier = new RequestNotifier(wnd, this.onRequestFound, this);
},
onRequestFound: function(frame, node, entry, scanComplete)
@@ -631,17 +631,17 @@ let errorsDataSource =
!/^https?:/i.test(message.sourceName) &&
(/adblock/i.test(message.errorMessage) || /adblock/i.test(message.sourceName) ||
message.errorMessage.indexOf(addonID) >= 0 || message.sourceName && message.sourceName.indexOf(addonID) >= 0));
});
if (messages.length > 10) // Only the last 10 messages
messages = messages.slice(messages.length - 10, messages.length);
// Censor app and profile paths in error messages
- let censored = {__proto__: null};
+ let censored = Object.create(null);
let pathList = [["ProfD", "%PROFILE%"], ["GreD", "%GRE%"], ["CurProcD", "%APP%"]];
for (let i = 0; i < pathList.length; i++)
{
let [pathID, placeholder] = pathList[i];
try
{
let file = FileUtils.getDir(pathID, [], false);
censored[file.path.replace(/[\\\/]+$/, '')] = placeholder;
@@ -904,32 +904,32 @@ let issuesDataSource =
if (subscription.disabled)
continue;
for each (let filter in subscription.filters)
if (filter instanceof BlockingFilter && filter.disabled)
disabledMatcher.add(filter);
}
- let seenFilters = {__proto__: null};
+ let seenFilters = Object.create(null);
for each (let request in requestsDataSource.origRequests)
{
if (request.filter)
continue;
let filter = disabledMatcher.matchesAny(request.location, request.typeDescr, request.docDomain, request.thirdParty);
if (filter && !(filter.text in seenFilters))
{
this.disabledFilters.push(filter);
seenFilters[filter.text] = true;
}
}
// Find disabled subscriptions with filters matching any of the requests
- let seenSubscriptions = {__proto__: null};
+ let seenSubscriptions = Object.create(null);
for each (let subscription in FilterStorage.subscriptions)
{
if (!subscription.disabled)
continue;
disabledMatcher.clear();
for each (let filter in subscription.filters)
if (filter instanceof BlockingFilter)
« no previous file with comments | « chrome/content/ui/filters-subscriptionview.js ('k') | chrome/content/ui/sidebar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld