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:
Florian Müllner
2019-08-21 15:13:43 +00:00
committed by Florian Müllner
parent c14f7f6fb8
commit fca516e58a
4 changed files with 5 additions and 5 deletions
+2 -2
View File
@@ -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,
+1 -1
View File
@@ -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)) {
+1 -1
View File
@@ -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() {