Bug 1595875, fix handling of return value of FormAutoComplete:GetSelectedIndex that was incorrectly removed by 1573836, r=MattN

Differential Revision: https://phabricator.services.mozilla.com/D52720

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Neil Deakin 2019-11-14 10:07:52 +00:00
Родитель d620f10c6d
Коммит bf4c789cae
1 изменённых файлов: 14 добавлений и 3 удалений

Просмотреть файл

@ -182,9 +182,20 @@ class AutoCompleteChild extends JSWindowActorChild {
// time it changes because not every action that can change the
// selectedIndex is trivial to catch (e.g. moving the mouse over the
// list).
return Services.cpmm.sendSyncMessage("FormAutoComplete:GetSelectedIndex", {
browsingContext: this.browsingContext,
});
let selectedIndexResult = Services.cpmm.sendSyncMessage(
"FormAutoComplete:GetSelectedIndex",
{
browsingContext: this.browsingContext,
}
);
if (
selectedIndexResult.length != 1 ||
!Number.isInteger(selectedIndexResult[0])
) {
throw new Error("Invalid autocomplete selectedIndex");
}
return selectedIndexResult[0];
}
get popupOpen() {