From 97b7dee5646a1245d723e0b2a5d2e6660a976034 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 8 Jul 2022 05:38:39 +0200 Subject: [PATCH] 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: --- js/misc/objectManager.js | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/js/misc/objectManager.js b/js/misc/objectManager.js index 724e5d24e..da9b78fd5 100644 --- a/js/misc/objectManager.js +++ b/js/misc/objectManager.js @@ -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); } @@ -168,18 +168,18 @@ var ObjectManager = class extends Signals.EventEmitter { } this._managerProxy.connectSignal('InterfacesAdded', - (objectManager, sender, [objectPath, interfaces]) => { - let interfaceNames = Object.keys(interfaces); - for (let i = 0; i < interfaceNames.length; i++) - this._addInterface(objectPath, interfaceNames[i]); - }); + (objectManager, sender, [objectPath, interfaces]) => { + let interfaceNames = Object.keys(interfaces); + for (let i = 0; i < interfaceNames.length; i++) + this._addInterface(objectPath, interfaceNames[i]); + }); this._managerProxy.connectSignal('InterfacesRemoved', - (objectManager, sender, [objectPath, interfaceNames]) => { - for (let i = 0; i < interfaceNames.length; i++) - this._removeInterface(objectPath, interfaceNames[i]); - }); + (objectManager, sender, [objectPath, interfaceNames]) => { + for (let i = 0; i < interfaceNames.length; i++) + this._removeInterface(objectPath, interfaceNames[i]); + }); - if (Object.keys(this._interfaceInfos).length == 0) { + if (Object.keys(this._interfaceInfos).length === 0) { this._tryToCompleteLoad(); return; } @@ -223,9 +223,8 @@ var ObjectManager = class extends Signals.EventEmitter { // Prevent load from completing until the interface is loaded this._numLoadInhibitors++; - this._addInterface(objectPath, - interfaceName, - this._tryToCompleteLoad.bind(this)); + this._addInterface(objectPath, interfaceName, + this._tryToCompleteLoad.bind(this)); } } this._tryToCompleteLoad();