cleanup: Use GObject.NotImplementedError
Since version 1.50.0, gjs defines GObject.NotImplementedError for throwing errors when a virtual method that requires a subclass implementation is not defined. So use this instead of a generic JS Error in such cases. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/84
This commit is contained in:
@@ -251,7 +251,8 @@ class BaseButton {
|
||||
}
|
||||
|
||||
_onClicked(_actor, _button) {
|
||||
throw new Error('Not implemented');
|
||||
throw new GObject.NotImplementedError(
|
||||
`_onClicked in ${this.constructor.name}`);
|
||||
}
|
||||
|
||||
_canOpenPopupMenu() {
|
||||
@@ -265,7 +266,8 @@ class BaseButton {
|
||||
}
|
||||
|
||||
_isFocused() {
|
||||
throw new Error('Not implemented');
|
||||
throw new GObject.NotImplementedError(
|
||||
`_isFocused in ${this.constructor.name}`);
|
||||
}
|
||||
|
||||
_updateStyle() {
|
||||
@@ -276,7 +278,8 @@ class BaseButton {
|
||||
}
|
||||
|
||||
_windowEnteredOrLeftMonitor(_metaDisplay, _monitorIndex, _metaWindow) {
|
||||
throw new Error('Not implemented');
|
||||
throw new GObject.NotImplementedError(
|
||||
`_windowEnteredOrLeftMonitor in ${this.constructor.name}`);
|
||||
}
|
||||
|
||||
_isWindowVisible(window) {
|
||||
@@ -288,7 +291,8 @@ class BaseButton {
|
||||
}
|
||||
|
||||
_updateVisibility() {
|
||||
throw new Error('Not implemented');
|
||||
throw new GObject.NotImplementedError(
|
||||
`_updateVisibility in ${this.constructor.name}`);
|
||||
}
|
||||
|
||||
_getIconGeometry() {
|
||||
@@ -301,7 +305,8 @@ class BaseButton {
|
||||
}
|
||||
|
||||
_updateIconGeometry() {
|
||||
throw new Error('Not implemented');
|
||||
throw new GObject.NotImplementedError(
|
||||
`_updateIconGeometry in ${this.constructor.name}`);
|
||||
}
|
||||
|
||||
_onDestroy() {
|
||||
|
||||
Reference in New Issue
Block a user