HTMLSelectElement: fix selectedOptions when selectedIndex < 0
Closes https://github.com/dart-lang/sdk/pull/54618 Also adds a comment to go.sh mentioning vpython3 comes with depot_tools. GitOrigin-RevId: 5e057703067c24d9d41bac75b6251c8f3a2fddd3 Change-Id: I937d8618c24602b4c0844d8a52ff00095836bca8 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/346220 Reviewed-by: Sigmund Cherem <sigmund@google.com> Commit-Queue: Srujan Gaddam <srujzs@google.com>
This commit is contained in:
committed by
Commit Queue
parent
4983ea79be
commit
5d18799eae
@@ -27715,7 +27715,8 @@ class SelectElement extends HtmlElement {
|
||||
var options = this.options.where((o) => o.selected).toList();
|
||||
return new UnmodifiableListView(options);
|
||||
} else {
|
||||
return [this.options[this.selectedIndex!]];
|
||||
var i = this.selectedIndex!;
|
||||
return i < 0 ? [] : [this.options[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,9 @@ if [[ "$1" != "" ]] ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# vpython3 is available through depot_tools. See
|
||||
# https://github.com/dart-lang/sdk/wiki/Building for instructions on installing
|
||||
# depot_tools.
|
||||
reset && \
|
||||
vpython3 ./dartdomgenerator.py --systems="$SYSTEMS" --logging=40 --update-dom-metadata --gen-interop "$ARG_OPTION"
|
||||
|
||||
|
||||
@@ -20,7 +20,8 @@ $!MEMBERS
|
||||
var options = this.options.where((o) => o.selected).toList();
|
||||
return new UnmodifiableListView(options);
|
||||
} else {
|
||||
return [this.options[this.selectedIndex$NULLASSERT]];
|
||||
var i = this.selectedIndex$NULLASSERT;
|
||||
return i < 0 ? [] : [this.options[i]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user