Remove our custom hashmap implementation

gjs uses Spidermonkey 24, which implements Map from the ES6
specification, so we can use that instead.

https://bugzilla.gnome.org/show_bug.cgi?id=722210
This commit is contained in:
Giovanni Campagna
2014-01-14 23:49:47 +01:00
parent 6dcc3d637f
commit bfb0235fc6
7 changed files with 24 additions and 177 deletions

View File

@ -19,7 +19,6 @@ const BoxPointer = imports.ui.boxpointer;
const CtrlAltTab = imports.ui.ctrlAltTab;
const GnomeSession = imports.misc.gnomeSession;
const GrabHelper = imports.ui.grabHelper;
const Hash = imports.misc.hash;
const Lightbox = imports.ui.lightbox;
const Main = imports.ui.main;
const PointerWatcher = imports.ui.pointerWatcher;
@ -1899,7 +1898,7 @@ const MessageTray = new Lang.Class({
Shell.KeyBindingMode.OVERVIEW,
Lang.bind(this, this._expandActiveNotification));
this._sources = new Hash.Map();
this._sources = new Map();
this._chatSummaryItemsCount = 0;
this._trayDwellTimeoutId = 0;
@ -1936,7 +1935,7 @@ const MessageTray = new Lang.Class({
},
_updateNoMessagesLabel: function() {
this._noMessages.visible = this._sources.size() == 0;
this._noMessages.visible = this._sources.size == 0;
},
_sessionUpdated: function() {
@ -2099,7 +2098,8 @@ const MessageTray = new Lang.Class({
},
_removeSource: function(source) {
let [, obj] = this._sources.delete(source);
let obj = this._sources.get(source);
this._sources.delete(source);
let summaryItem = obj.summaryItem;
if (source.isChat)
@ -2120,7 +2120,7 @@ const MessageTray = new Lang.Class({
},
getSources: function() {
return this._sources.keys();
return [k for (k of this._sources.keys())];
},
_onSourceEnableChanged: function(policy, source) {