[polari] cleanup: Disambiguate assignments in arrow functions
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [polari] cleanup: Disambiguate assignments in arrow functions
- Date: Wed, 14 Aug 2019 19:06:20 +0000 (UTC)
commit 74f2a7fa30e66a8d8fecbea5520ed7c4da0e276f
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Aug 6 17:48:25 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/polari/merge_requests/133
src/appNotifications.js | 2 +-
src/application.js | 2 +-
src/chatView.js | 2 +-
src/serverRoomManager.js | 2 +-
src/userList.js | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/appNotifications.js b/src/appNotifications.js
index 91a8997..5ba1c81 100644
--- a/src/appNotifications.js
+++ b/src/appNotifications.js
@@ -82,7 +82,7 @@ var UndoNotification = GObject.registerClass({
this.connect('destroy', () => this.close());
- this.addButton(_('Undo'), () => this._undo = true);
+ this.addButton(_('Undo'), () => (this._undo = true));
}
close() {
diff --git a/src/application.js b/src/application.js
index be52957..b1fcc9a 100644
--- a/src/application.js
+++ b/src/application.js
@@ -205,7 +205,7 @@ var Application = GObject.registerClass({
}, {
name: 'leave-current-room',
activate: this._onLeaveCurrentRoom.bind(this),
- create_hook: a => a.enabled = false,
+ create_hook: a => (a.enabled = false),
accels: ['<Primary>w']
}, {
name: 'reconnect-room',
diff --git a/src/chatView.js b/src/chatView.js
index 64a8106..1b1f7ec 100644
--- a/src/chatView.js
+++ b/src/chatView.js
@@ -812,7 +812,7 @@ var ChatView = GObject.registerClass({
else
hoveredButtonTags = [];
- hoveredButtonTags.forEach(t => t.hover = true);
+ hoveredButtonTags.forEach(t => (t.hover = true));
this._hoveredButtonTags.forEach(t => {
t.hover = hoveredButtonTags.includes(t);
});
diff --git a/src/serverRoomManager.js b/src/serverRoomManager.js
index 26c41e3..99f6d5d 100644
--- a/src/serverRoomManager.js
+++ b/src/serverRoomManager.js
@@ -247,7 +247,7 @@ var ServerRoomList = GObject.registerClass({
return false;
let name = model.get_value(iter, RoomListColumn.NAME);
- return exactMatch = _strBaseEqual(newName, name);
+ return (exactMatch = _strBaseEqual(newName, name));
});
if (exactMatch)
diff --git a/src/userList.js b/src/userList.js
index ce74517..9384728 100644
--- a/src/userList.js
+++ b/src/userList.js
@@ -14,7 +14,7 @@ class UserListPopover extends Gtk.Popover {
this._createWidget();
- this.connect('closed', () => this._entry.text = '');
+ this.connect('closed', () => (this._entry.text = ''));
this.connect('map', () => {
this._revealer.transition_duration = 0;
this._updateContentHeight();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]