[gnome-shell/gnome-42] signalTracker: Use a const variable to hold the tracked object value



commit 9a068f0a986ee0d0f42adfa2bc71f5e8ca315fdc
Author: Marco Trevisan (Treviño) <mail 3v1n0 net>
Date:   Wed Jul 6 17:59:39 2022 +0200

    signalTracker: Use a const variable to hold the tracked object value
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2366>
    (cherry picked from commit 9abf3508fdec05c21198d884e15cabfd3d143c89)

 js/misc/signalTracker.js | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
---
diff --git a/js/misc/signalTracker.js b/js/misc/signalTracker.js
index 3e03df4748..0a7bbdb6c3 100644
--- a/js/misc/signalTracker.js
+++ b/js/misc/signalTracker.js
@@ -211,10 +211,7 @@ function connectObject(thisObj, ...args) {
         args = rest;
     }
 
-    let [obj] = args;
-    if (!obj)
-        obj = globalThis;
-
+    const obj = args.at(0) ?? globalThis;
     const tracker = SignalManager.getDefault().getSignalTracker(thisObj);
     tracker.track(obj, ...signalIds);
 }


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