[gnome-shell/wip/fmuellner/minor-bug-fixes: 4/9] iconGrid: Fix nonsense condition



commit 403929fabe4b71297c7514c87761005b83981311
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue Jan 29 22:43:41 2019 +0100

    iconGrid: Fix nonsense condition
    
    Just like the "in" operator in the previous patch, "instanceof" has
    a lower precedence than negation, resulting in the nonsense condition
    of "true instanceof BaseIcon".
    
    Add parentheses to get the intended behavior.
    
    Spotted by eslint.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/375

 js/ui/iconGrid.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 6d6e2284f..cd54d50a3 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -670,7 +670,7 @@ var IconGrid = GObject.registerClass({
     }
 
     addItem(item, index) {
-        if (!item.icon instanceof BaseIcon)
+        if (!(item.icon instanceof BaseIcon))
             throw new Error('Only items with a BaseIcon icon property can be added to IconGrid');
 
         this._items.push(item);


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