[gnome-shell-extensions] cleanup: Disambiguate assignments in arrow functions
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] cleanup: Disambiguate assignments in arrow functions
- Date: Wed, 21 Aug 2019 17:21:32 +0000 (UTC)
commit fca516e58a9891bab2c6788815d035de8a1171b5
Author: Florian Müllner <fmuellner gnome org>
Date: Wed Aug 7 04:14:26 2019 +0200
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
extensions/apps-menu/extension.js | 4 ++--
extensions/auto-move-windows/extension.js | 2 +-
extensions/native-window-placement/extension.js | 2 +-
extensions/window-list/extension.js | 2 +-
4 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index 22aca44..1d586aa 100644
--- a/extensions/apps-menu/extension.js
+++ b/extensions/apps-menu/extension.js
@@ -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,
diff --git a/extensions/auto-move-windows/extension.js b/extensions/auto-move-windows/extension.js
index 16b5461..4536e85 100644
--- a/extensions/auto-move-windows/extension.js
+++ b/extensions/auto-move-windows/extension.js
@@ -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);
diff --git a/extensions/native-window-placement/extension.js b/extensions/native-window-placement/extension.js
index ed319f7..62cb3f8 100644
--- a/extensions/native-window-placement/extension.js
+++ b/extensions/native-window-placement/extension.js
@@ -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)) {
diff --git a/extensions/window-list/extension.js b/extensions/window-list/extension.js
index 5e13b9e..f7f64d0 100644
--- a/extensions/window-list/extension.js
+++ b/extensions/window-list/extension.js
@@ -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() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]