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

Unified Diff: lib/sync.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 | « lib/subscriptionClasses.js ('k') | lib/timeline.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/sync.js
===================================================================
--- a/lib/sync.js
+++ b/lib/sync.js
@@ -245,17 +245,17 @@ ABPStore.prototype =
if (record.id != filtersRecordID)
return;
this._log.trace("Merging in remote data");
let data = record.cleartext.subscriptions;
// First make sure we have the same subscriptions on both sides
- let seenSubscription = {__proto__: null};
+ let seenSubscription = Object.create(null);
for (let remoteSubscription of data)
{
seenSubscription[remoteSubscription.url] = true;
if (remoteSubscription.url in FilterStorage.knownSubscriptions)
{
let subscription = FilterStorage.knownSubscriptions[remoteSubscription.url];
if (!trackerInstance.didSubscriptionChange(remoteSubscription))
{
@@ -287,17 +287,17 @@ ABPStore.prototype =
if (!(subscription.url in seenSubscription) && subscription instanceof DownloadableSubscription && !trackerInstance.didSubscriptionChange(subscription))
{
// Subscription was removed remotely, remove it locally as well
FilterStorage.removeSubscription(subscription);
}
}
// Now sync the custom filters
- let seenFilter = {__proto__: null};
+ let seenFilter = Object.create(null);
for (let remoteSubscription of data)
{
if (!("filters" in remoteSubscription))
continue;
for (let remoteFilter of remoteSubscription.filters)
{
seenFilter[remoteFilter.text] = true;
« no previous file with comments | « lib/subscriptionClasses.js ('k') | lib/timeline.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld