objectManager: Use non-legacy style

There are a couple of places left where we still use the old
indentation style, update them before making code changes.

After that, there are only a couple of non-type-safe comparisons
left of legacy style, so change those as well while we're at it.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2344>
This commit is contained in:
Florian Müllner 2022-07-08 05:38:39 +02:00 committed by Marge Bot
parent 31a50cb4de
commit 97b7dee564

View File

@ -68,11 +68,11 @@ var ObjectManager = class extends Signals.EventEmitter {
}
_tryToCompleteLoad() {
if (this._numLoadInhibitors == 0)
if (this._numLoadInhibitors === 0)
return;
this._numLoadInhibitors--;
if (this._numLoadInhibitors == 0) {
if (this._numLoadInhibitors === 0) {
if (this._onLoaded)
this._onLoaded();
}
@ -142,7 +142,7 @@ var ObjectManager = class extends Signals.EventEmitter {
if (index >= 0)
this._interfaces[interfaceName].splice(index, 1);
if (this._interfaces[interfaceName].length == 0)
if (this._interfaces[interfaceName].length === 0)
delete this._interfaces[interfaceName];
}
@ -150,7 +150,7 @@ var ObjectManager = class extends Signals.EventEmitter {
this._objects[objectPath][interfaceName] = null;
if (Object.keys(this._objects[objectPath]).length == 0) {
if (Object.keys(this._objects[objectPath]).length === 0) {
delete this._objects[objectPath];
this.emit('object-removed', objectPath);
}
@ -179,7 +179,7 @@ var ObjectManager = class extends Signals.EventEmitter {
this._removeInterface(objectPath, interfaceNames[i]);
});
if (Object.keys(this._interfaceInfos).length == 0) {
if (Object.keys(this._interfaceInfos).length === 0) {
this._tryToCompleteLoad();
return;
}
@ -223,8 +223,7 @@ var ObjectManager = class extends Signals.EventEmitter {
// Prevent load from completing until the interface is loaded
this._numLoadInhibitors++;
this._addInterface(objectPath,
interfaceName,
this._addInterface(objectPath, interfaceName,
this._tryToCompleteLoad.bind(this));
}
}