[gnome-shell] dialog: Use GObject.set() over Object.assign()



commit 68e580e394f734e54bcd67410f984a360fa56e72
Author: Florian Müllner <fmuellner gnome org>
Date:   Wed Jun 26 19:16:41 2019 +0200

    dialog: Use GObject.set() over Object.assign()
    
    gjs has provided that as a more idiomatic replacement for a while.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/600

 js/ui/dialog.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/dialog.js b/js/ui/dialog.js
index 553b81c78..af057e631 100644
--- a/js/ui/dialog.js
+++ b/js/ui/dialog.js
@@ -214,7 +214,10 @@ var MessageDialogContent = GObject.registerClass({
     }
 
     set icon(icon) {
-        Object.assign(this._icon, { gicon: icon, visible: icon != null });
+        this._icon.set({
+            gicon: icon,
+            visible: icon != null
+        });
         this.notify('icon');
     }
 
@@ -231,7 +234,10 @@ var MessageDialogContent = GObject.registerClass({
     }
 
     _setLabel(label, prop, value) {
-        Object.assign(label, { text: value || '', visible: value != null });
+        label.set({
+            text: value || '',
+            visible: value != null
+        });
         this.notify(prop);
     }
 


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