[gnome-shell] objectManager: Use non-legacy style



commit 97b7dee5646a1245d723e0b2a5d2e6660a976034
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jul 8 05:38:39 2022 +0200

    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>

 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 724e5d24ea..da9b78fd57 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();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]