/* * Copyright (c) 2021, Andreas Kling * * SPDX-License-Identifier: BSD-2-Clause */ #include #include #include #include #include namespace Web::Bindings { JS::Value HTMLCollectionWrapper::get(JS::PropertyName const& name, JS::Value receiver, bool without_side_effects) const { auto* item = const_cast(impl()).named_item(name.to_string()); if (!item) return Base::get(name, receiver, without_side_effects); return JS::Value { wrap(global_object(), *item) }; } JS::Value HTMLCollectionWrapper::get_by_index(u32 property_index) const { auto* item = const_cast(impl()).item(property_index); if (!item) return Base::get_by_index(property_index); return wrap(global_object(), *item); } }