mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 08:17:34 +00:00
LibWeb: Don't assume name is string in HTMLCollectionWrapper::get()
If the property name is not a string (symbol or integer), we should just defer to the base class instead of trying to handle it. Fixes #6575.
This commit is contained in:
parent
6efcc2fc99
commit
f7a33043e0
1 changed files with 2 additions and 0 deletions
|
@ -14,6 +14,8 @@ namespace Web::Bindings {
|
||||||
|
|
||||||
JS::Value HTMLCollectionWrapper::get(JS::PropertyName const& name, JS::Value receiver, bool without_side_effects) const
|
JS::Value HTMLCollectionWrapper::get(JS::PropertyName const& name, JS::Value receiver, bool without_side_effects) const
|
||||||
{
|
{
|
||||||
|
if (!name.is_string())
|
||||||
|
return Base::get(name, receiver, without_side_effects);
|
||||||
auto* item = const_cast<DOM::HTMLCollection&>(impl()).named_item(name.to_string());
|
auto* item = const_cast<DOM::HTMLCollection&>(impl()).named_item(name.to_string());
|
||||||
if (!item)
|
if (!item)
|
||||||
return Base::get(name, receiver, without_side_effects);
|
return Base::get(name, receiver, without_side_effects);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue