From 5b7631898c5ef9057edca390b14d2dccc68df2e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Fri, 19 Jul 2019 20:45:27 +0200 Subject: [PATCH] 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 --- extensions/window-list/extension.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js index 690c407c..a89a449e 100644 --- a/extensions/window-list/extension.js +++ b/extensions/window-list/extension.js @@ -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() {