[gnome-shell] cleanup: Avoid pointless "renames" in destructuring



commit 111f87a1b2dbbba1e1acdf83bb29bf57219eacb4
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Sep 12 17:19:51 2019 +0200

    cleanup: Avoid pointless "renames" in destructuring
    
    ES5 allows to rename variables in object destructuring, however this
    only makes sense when we want to use a different name than the object
    property.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/731

 js/ui/extensionSystem.js    |  2 +-
 js/ui/notificationDaemon.js | 18 +++++++++---------
 js/ui/workspace.js          |  4 ++--
 3 files changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js
index e8f2079437..7c36d70903 100644
--- a/js/ui/extensionSystem.js
+++ b/js/ui/extensionSystem.js
@@ -286,7 +286,7 @@ var ExtensionManager = class {
     reloadExtension(oldExtension) {
         // Grab the things we'll need to pass to createExtensionObject
         // to reload it.
-        let { uuid: uuid, dir: dir, type: type } = oldExtension;
+        let { uuid, dir, type } = oldExtension;
 
         // Then unload the old extension.
         this.unloadExtension(oldExtension);
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index ece95e790b..aa65bf6c84 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -541,15 +541,15 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
         super(source);
         this._serialized = GLib.Variant.new('a{sv}', notification);
 
-        let { "title": title,
-              "body": body,
-              "icon": gicon,
-              "urgent": urgent,
-              "priority": priority,
-              "buttons": buttons,
+        let { title,
+              body,
+              icon: gicon,
+              urgent,
+              priority,
+              buttons,
               "default-action": defaultAction,
               "default-action-target": defaultActionTarget,
-              "timestamp": time } = notification;
+              timestamp: time } = notification;
 
         if (priority) {
             let urgency = PRIORITY_URGENCY_MAP[priority.unpack()];
@@ -590,8 +590,8 @@ class GtkNotificationDaemonNotification extends MessageTray.Notification {
     }
 
     _onButtonClicked(button) {
-        let { 'action': action, 'target': actionTarget } = button;
-        this._activateAction(action.unpack(), actionTarget);
+        let { action, target } = button;
+        this._activateAction(action.unpack(), target);
     }
 
     activate() {
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index d866e843f9..f09637b89b 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -903,7 +903,7 @@ var LayoutStrategy = class {
     computeWindowSlots(layout, area) {
         this._computeRowSizes(layout);
 
-        let { rows: rows, scale: scale } = layout;
+        let { rows, scale } = layout;
 
         let slots = [];
 
@@ -978,7 +978,7 @@ var LayoutStrategy = class {
 
 var UnalignedLayoutStrategy = class extends LayoutStrategy {
     _computeRowSizes(layout) {
-        let { rows: rows, scale: scale } = layout;
+        let { rows, scale } = layout;
         for (let i = 0; i < rows.length; i++) {
             let row = rows[i];
             row.width = row.fullWidth * scale + (row.windows.length - 1) * this._columnSpacing;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]