[gnome-shell/gnome-3-24] Don't use 'undefined' as boolean
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-24] Don't use 'undefined' as boolean
- Date: Thu, 13 Jul 2017 15:35:56 +0000 (UTC)
commit 091fb4ba2e86c22a4469a62ddf8f87df16187e54
Author: Florian Müllner <fmuellner gnome org>
Date: Tue Jun 13 06:49:07 2017 +0200
Don't use 'undefined' as boolean
Make sure we pass a proper false value instead of undefined to
avoid warnings.
https://bugzilla.gnome.org/show_bug.cgi?id=781471
js/ui/keyboard.js | 2 +-
js/ui/notificationDaemon.js | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index 4af1f1a..6c43888 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -570,7 +570,7 @@ const Keyboard = new Lang.Class({
shouldTakeEvent: function(event) {
let actor = event.get_source();
return Main.layoutManager.keyboardBox.contains(actor) ||
- actor._extended_keys || actor.extended_key;
+ !!actor._extended_keys || !!actor.extended_key;
},
_clearKeyboardRestTimer: function() {
diff --git a/js/ui/notificationDaemon.js b/js/ui/notificationDaemon.js
index 6209625..315bfdb 100644
--- a/js/ui/notificationDaemon.js
+++ b/js/ui/notificationDaemon.js
@@ -391,10 +391,10 @@ const FdoNotificationDaemon = new Lang.Class({
notification.setUrgency(MessageTray.Urgency.CRITICAL);
break;
}
- notification.setResident(hints.resident == true);
+ notification.setResident(!!hints.resident);
// 'transient' is a reserved keyword in JS, so we have to retrieve the value
// of the 'transient' hint with hints['transient'] rather than hints.transient
- notification.setTransient(hints['transient'] == true);
+ notification.setTransient(!!hints['transient']);
let sourceGIcon = source.useNotificationIcon ? gicon : null;
source.processNotification(notification, sourceGIcon);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]