From 7d2c5c1ac9e3fb9972fb58e4b205aef5f7132d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Sun, 30 Jun 2019 01:03:46 +0200 Subject: [PATCH] dialog: Use Object.assign() for default property value Either Params.parse() or Object.assign() are more concise for providing default values in object literals (sadly default parameters won't work here). https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626 --- js/ui/dialog.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/js/ui/dialog.js b/js/ui/dialog.js index 4989470c4..fd0069cad 100644 --- a/js/ui/dialog.js +++ b/js/ui/dialog.js @@ -180,10 +180,8 @@ var MessageDialogContent = GObject.registerClass({ this._subtitle.clutter_text.set(textProps); this._body.clutter_text.set(textProps); - if (!params.hasOwnProperty('style_class')) - params.style_class = 'message-dialog-main-layout'; - - super._init(params); + let defaultParams = { style_class: 'message-dialog-main-layout' }; + super._init(Object.assign(defaultParams, params)); this.messageBox = new St.BoxLayout({ style_class: 'message-dialog-content', x_expand: true,