Bind "this" for various methods

For extremely silly reasons with how the class framework works, the wrapper
method requires "this" to be bound in order for it to work, or else we'll
emit errors in strict mode.

https://bugzilla.gnome.org/show_bug.cgi?id=707892
This commit is contained in:
Jasper St. Pierre 2013-09-10 21:53:19 -04:00
parent 9ba970b83d
commit 2d8ed4c77f
2 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@ const BaseAppView = new Lang.Class({
}, },
loadGrid: function() { loadGrid: function() {
this._allItems.sort(this._compareItems); this._allItems.sort(Lang.bind(this, this._compareItems));
for (let i = 0; i < this._allItems.length; i++) { for (let i = 0; i < this._allItems.length; i++) {
let id = this._getItemId(this._allItems[i]); let id = this._getItemId(this._allItems[i]);

View File

@ -244,7 +244,7 @@ const NMConnectionSection = new Lang.Class({
this.emit('activation-failed', reason); this.emit('activation-failed', reason);
})); }));
let pos = Util.insertSorted(this._connections, connection, this._connectionSortFunction); let pos = Util.insertSorted(this._connections, connection, Lang.bind(this, this._connectionSortFunction));
this._labelSection.addMenuItem(item.labelItem, pos); this._labelSection.addMenuItem(item.labelItem, pos);
this._switchSection.addMenuItem(item.switchItem, pos); this._switchSection.addMenuItem(item.switchItem, pos);
this._connectionItems.set(connection.get_uuid(), item); this._connectionItems.set(connection.get_uuid(), item);