js: Check for this.constructor type instead of new.target
Use more ES6-inspired check for classes initializations. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/503
This commit is contained in:
@ -125,8 +125,8 @@ class InputSourceSwitcher extends SwitcherPopup.SwitcherList {
|
||||
|
||||
var InputSourceSettings = class {
|
||||
constructor() {
|
||||
if (new.target === InputSourceSettings)
|
||||
throw new TypeError('Cannot instantiate abstract class ' + new.target.name);
|
||||
if (this.constructor === InputSourceSettings)
|
||||
throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`);
|
||||
}
|
||||
|
||||
_emitInputSourcesChanged() {
|
||||
|
Reference in New Issue
Block a user