cleanup: Disambiguate assignments in arrow functions
As arrow functions have an implicit return value, an assignment of this.foo = bar could have been intended as a this.foo === bar comparison. To catch those errors, we will disallow these kinds of assignments unless they are marked explicitly by an extra pair of parentheses. https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/91
This commit is contained in:
committed by
Florian Müllner
parent
c14f7f6fb8
commit
fca516e58a
@@ -577,8 +577,8 @@ class ApplicationsButton extends PanelMenu.Button {
|
||||
});
|
||||
this.categoriesScrollBox.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC);
|
||||
vscroll = this.categoriesScrollBox.get_vscroll_bar();
|
||||
vscroll.connect('scroll-start', () => this.menu.passEvents = true);
|
||||
vscroll.connect('scroll-stop', () => this.menu.passEvents = false);
|
||||
vscroll.connect('scroll-start', () => (this.menu.passEvents = true));
|
||||
vscroll.connect('scroll-stop', () => (this.menu.passEvents = false));
|
||||
this.leftBox.add(this.categoriesScrollBox, {
|
||||
expand: true,
|
||||
x_fill: true,
|
||||
|
||||
@@ -124,7 +124,7 @@ function myCheckWorkspaces() {
|
||||
}
|
||||
|
||||
// make sure the original method only removes empty workspaces at the end
|
||||
keepAliveWorkspaces.forEach(ws => ws._keepAliveId = 1);
|
||||
keepAliveWorkspaces.forEach(ws => (ws._keepAliveId = 1));
|
||||
prevCheckWorkspaces.call(this);
|
||||
keepAliveWorkspaces.forEach(ws => delete ws._keepAliveId);
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ class NaturalLayoutStrategy extends Workspace.LayoutStrategy {
|
||||
for (let i = 0; i < rects.length; i++) {
|
||||
for (let j = 0; j < rects.length; j++) {
|
||||
let adjustments = [-1, -1, 1, 1]
|
||||
.map(v => v *= WINDOW_PLACEMENT_NATURAL_GAPS);
|
||||
.map(v => (v *= WINDOW_PLACEMENT_NATURAL_GAPS));
|
||||
let iAdjusted = rects[i].adjusted(...adjustments);
|
||||
let jAdjusted = rects[j].adjusted(...adjustments);
|
||||
if (i != j && iAdjusted.overlap(jAdjusted)) {
|
||||
|
||||
@@ -849,7 +849,7 @@ const WindowList = GObject.registerClass({
|
||||
});
|
||||
|
||||
this._windowList.reactive = visible;
|
||||
this._windowList.get_children().forEach(c => c.reactive = visible);
|
||||
this._windowList.get_children().forEach(c => (c.reactive = visible));
|
||||
}
|
||||
|
||||
_getPreferredUngroupedWindowListWidth() {
|
||||
|
||||
Reference in New Issue
Block a user