summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-23 15:45:54 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-23 15:45:54 +0200
commitf7a33043e0d3fcde50db7ce68e9032ca60c77d72 (patch)
treea9f64d7fe76941a825ad9a2725cab5caade7dc11 /Userland
parent6efcc2fc99b513f4d766fbba0599549fa44023c3 (diff)
downloadserenity-f7a33043e0d3fcde50db7ce68e9032ca60c77d72.zip
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.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibWeb/Bindings/HTMLCollectionWrapperCustom.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/HTMLCollectionWrapperCustom.cpp b/Userland/Libraries/LibWeb/Bindings/HTMLCollectionWrapperCustom.cpp
index dae42548f1..1bec8b5fce 100644
--- a/Userland/Libraries/LibWeb/Bindings/HTMLCollectionWrapperCustom.cpp
+++ b/Userland/Libraries/LibWeb/Bindings/HTMLCollectionWrapperCustom.cpp
@@ -14,6 +14,8 @@ namespace Web::Bindings {
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());
if (!item)
return Base::get(name, receiver, without_side_effects);