ibusCandidatePopup: Clarify assignment in condition

Most often it is a bug if the condition part of a for-loop contains the
assignment operator rather than the comparison one, so tools rightfully
emit a warning.

Clarify that the assignment is intentional in this case by adding
parentheses.

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:56:03 +01:00 committed by Florian Müllner
parent c264cc4131
commit a9ed128dce

View File

@ -236,7 +236,7 @@ var CandidatePopup = class CandidatePopup {
let indexes = []; let indexes = [];
let indexLabel; let indexLabel;
for (let i = 0; indexLabel = lookupTable.get_label(i); ++i) for (let i = 0; (indexLabel = lookupTable.get_label(i)); ++i)
indexes.push(indexLabel.get_text()); indexes.push(indexLabel.get_text());
Main.keyboard.resetSuggestions(); Main.keyboard.resetSuggestions();
@ -295,7 +295,7 @@ var CandidatePopup = class CandidatePopup {
_setTextAttributes(clutterText, ibusAttrList) { _setTextAttributes(clutterText, ibusAttrList) {
let attr; let attr;
for (let i = 0; attr = ibusAttrList.get(i); ++i) for (let i = 0; (attr = ibusAttrList.get(i)); ++i)
if (attr.get_attr_type() == IBus.AttrType.BACKGROUND) if (attr.get_attr_type() == IBus.AttrType.BACKGROUND)
clutterText.set_selection(attr.get_start_index(), attr.get_end_index()); clutterText.set_selection(attr.get_start_index(), attr.get_end_index());
} }