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:
@ -397,8 +397,8 @@ var PopupImageMenuItem = class extends PopupBaseMenuItem {
|
||||
|
||||
var PopupMenuBase = class {
|
||||
constructor(sourceActor, styleClass) {
|
||||
if (new.target === PopupMenuBase)
|
||||
throw new TypeError('Cannot instantiate abstract class ' + new.target.name);
|
||||
if (this.constructor === PopupMenuBase)
|
||||
throw new TypeError(`Cannot instantiate abstract class ${this.constructor.name}`);
|
||||
|
||||
this.sourceActor = sourceActor;
|
||||
this._parent = null;
|
||||
|
Reference in New Issue
Block a user