cleanup: Use object shorthand where possible

ES6 allows to omit property names where they match the name of the
assigned variable, which makes code less redunant and thus cleaner.
We will soon enforce that in our eslint rules, so make sure we use
the shorthand wherever possible.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/805
This commit is contained in:
Florian Müllner
2019-08-19 21:06:04 +02:00
committed by Georges Basile Stavracas Neto
parent 9eaa0089d0
commit c860409da5
40 changed files with 89 additions and 94 deletions

View File

@ -445,7 +445,7 @@ var LayoutManager = GObject.registerClass({
_createBackgroundManager(monitorIndex) {
let bgManager = new Background.BackgroundManager({ container: this._backgroundGroup,
layoutManager: this,
monitorIndex: monitorIndex });
monitorIndex });
bgManager.connect('changed', this._addBackgroundMenu.bind(this));
this._addBackgroundMenu(bgManager);
@ -955,7 +955,7 @@ var LayoutManager = GObject.registerClass({
findIndexForActor(actor) {
let [x, y] = actor.get_transformed_position();
let [w, h] = actor.get_transformed_size();
let rect = new Meta.Rectangle({ x: x, y: y, width: w, height: h });
let rect = new Meta.Rectangle({ x, y, width: w, height: h });
return global.display.get_monitor_index_for_rect(rect);
}
@ -1026,7 +1026,7 @@ var LayoutManager = GObject.registerClass({
h = Math.round(h);
if (actorData.affectsInputRegion && wantsInputRegion && actorData.actor.get_paint_visibility())
rects.push(new Meta.Rectangle({ x: x, y: y, width: w, height: h }));
rects.push(new Meta.Rectangle({ x, y, width: w, height: h }));
let monitor = null;
if (actorData.affectsStruts)
@ -1077,7 +1077,7 @@ var LayoutManager = GObject.registerClass({
}
let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1 });
let strut = new Meta.Strut({ rect: strutRect, side: side });
let strut = new Meta.Strut({ rect: strutRect, side });
struts.push(strut);
}
}