cleanup: Use optional chaining and ?? operator

Those operators have been supported since gjs switched to mozjs78
last cycle. While not ground-breaking, using it makes for a nice
cleanup here and there.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1517>
This commit is contained in:
Florian Müllner
2020-08-12 20:59:01 +02:00
committed by Marge Bot
parent c9df2f9370
commit 40e22eb524
18 changed files with 36 additions and 37 deletions

View File

@ -427,8 +427,7 @@ class CyclerHighlight extends St.Widget {
if (this._clone.source)
this._clone.source.sync_visibility();
let windowActor = this._window
? this._window.get_compositor_private() : null;
const windowActor = this._window?.get_compositor_private();
if (windowActor)
windowActor.hide();
@ -532,7 +531,7 @@ class GroupCyclerPopup extends CyclerPopup {
_getWindows() {
let app = Shell.WindowTracker.get_default().focus_app;
let appWindows = app ? app.get_windows() : [];
let appWindows = app?.get_windows() ?? [];
if (this._settings.get_boolean('current-workspace-only')) {
const workspaceManager = global.workspace_manager;