Commit e89fa5db authored by Peter Van der Beken's avatar Peter Van der Beken Committed by Richard Pospesel
Browse files

Bug 1770137 - Make notification code use Object.create. r=Gijs,freddyb,a=dsmith

Differential Revision: https://phabricator.services.mozilla.com/D146798
parent 46c2ca70
...@@ -40,8 +40,8 @@ var NotificationDB = { ...@@ -40,8 +40,8 @@ var NotificationDB = {
return; return;
} }
this.notifications = {}; this.notifications = Object.create(null);
this.byTag = {}; this.byTag = Object.create(null);
this.loaded = false; this.loaded = false;
this.tasks = []; // read/write operation queue this.tasks = []; // read/write operation queue
...@@ -111,7 +111,7 @@ var NotificationDB = { ...@@ -111,7 +111,7 @@ var NotificationDB = {
// populate the list of notifications by tag // populate the list of notifications by tag
if (this.notifications) { if (this.notifications) {
for (var origin in this.notifications) { for (var origin in this.notifications) {
this.byTag[origin] = {}; this.byTag[origin] = Object.create(null);
for (var id in this.notifications[origin]) { for (var id in this.notifications[origin]) {
var curNotification = this.notifications[origin][id]; var curNotification = this.notifications[origin][id];
if (curNotification.tag) { if (curNotification.tag) {
...@@ -344,8 +344,8 @@ var NotificationDB = { ...@@ -344,8 +344,8 @@ var NotificationDB = {
var origin = data.origin; var origin = data.origin;
var notification = data.notification; var notification = data.notification;
if (!this.notifications[origin]) { if (!this.notifications[origin]) {
this.notifications[origin] = {}; this.notifications[origin] = Object.create(null);
this.byTag[origin] = {}; this.byTag[origin] = Object.create(null);
} }
// We might have existing notification with this tag, // We might have existing notification with this tag,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment