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:
@ -786,8 +786,8 @@ var WindowPositionFlags = {
|
||||
|
||||
var LayoutStrategy = class {
|
||||
constructor(monitor, rowSpacing, columnSpacing) {
|
||||
if (new.target === LayoutStrategy)
|
||||
throw new TypeError('Cannot instantiate abstract type ' + new.target.name);
|
||||
if (this.constructor === LayoutStrategy)
|
||||
throw new TypeError(`Cannot instantiate abstract type ${this.constructor.name}`);
|
||||
|
||||
this._monitor = monitor;
|
||||
this._rowSpacing = rowSpacing;
|
||||
|
Reference in New Issue
Block a user