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
This commit is contained in:
Florian Müllner 2019-01-29 22:43:41 +01:00 committed by Florian Müllner
parent c353914dd0
commit a7943ff934

View File

@ -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);