signalTracker: Use a const variable to hold the tracked object value

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2366>
This commit is contained in:
Marco Trevisan (Treviño) 2022-07-06 17:59:39 +02:00
parent 371da8d394
commit 9abf3508fd

View File

@ -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);
}