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:

committed by
Marge Bot

parent
c9df2f9370
commit
40e22eb524
@ -226,7 +226,7 @@ var PopupBaseMenuItem = GObject.registerClass({
|
||||
}
|
||||
|
||||
getSensitive() {
|
||||
let parentSensitive = this._parent ? this._parent.sensitive : true;
|
||||
const parentSensitive = this._parent?.sensitive ?? true;
|
||||
return this._activatable && this._sensitive && parentSensitive;
|
||||
}
|
||||
|
||||
@ -504,7 +504,7 @@ var PopupMenuBase = class {
|
||||
}
|
||||
|
||||
getSensitive() {
|
||||
let parentSensitive = this._parent ? this._parent.sensitive : true;
|
||||
const parentSensitive = this._parent?.sensitive ?? true;
|
||||
return this._sensitive && parentSensitive;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user