mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 23:09:08 +00:00
LibJS: Handle both const and non-const Ts in Handle<T>::create()
Again, the const-ness only really involves Heap-internal metadata, so the callers shouldn't care about mutations here.
This commit is contained in:
parent
74e93a46ea
commit
70a2ca7fc0
Notes:
sideshowbarker
2024-07-17 16:23:55 +09:00
Author: https://github.com/mattco98
Commit: 70a2ca7fc0
Pull-request: https://github.com/SerenityOS/serenity/pull/17620
Issue: https://github.com/SerenityOS/serenity/issues/16988
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/linusg
6 changed files with 10 additions and 10 deletions
|
@ -84,13 +84,13 @@ Vector<JS::Handle<HTMLOptionElement>> HTMLSelectElement::list_of_options() const
|
|||
// and all the option element children of all the optgroup element children of the select element, in tree order.
|
||||
Vector<JS::Handle<HTMLOptionElement>> list;
|
||||
|
||||
for_each_child_of_type<HTMLOptionElement>([&](HTMLOptionElement const& option_element) {
|
||||
list.append(JS::make_handle(const_cast<HTMLOptionElement&>(option_element)));
|
||||
for_each_child_of_type<HTMLOptionElement>([&](HTMLOptionElement& option_element) {
|
||||
list.append(JS::make_handle(option_element));
|
||||
});
|
||||
|
||||
for_each_child_of_type<HTMLOptGroupElement>([&](HTMLOptGroupElement const& optgroup_element) {
|
||||
optgroup_element.for_each_child_of_type<HTMLOptionElement>([&](HTMLOptionElement const& option_element) {
|
||||
list.append(JS::make_handle(const_cast<HTMLOptionElement&>(option_element)));
|
||||
optgroup_element.for_each_child_of_type<HTMLOptionElement>([&](HTMLOptionElement& option_element) {
|
||||
list.append(JS::make_handle(option_element));
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue