Skip to content

Truly independent web browser

Meta: Allow Rust maplike interfaces to retain native has callbacks

Shannon Boothb3de15d9e292
diff --git a/Libraries/LibWeb/Bindings/Rust/src/bindings/maplike.rs b/Libraries/LibWeb/Bindings/Rust/src/bindings/maplike.rs
index aa9e78c972d..7b767b1ce5e 100644
--- a/Libraries/LibWeb/Bindings/Rust/src/bindings/maplike.rs
+++ b/Libraries/LibWeb/Bindings/Rust/src/bindings/maplike.rs
@@ -18,6 +18,10 @@ use crate::bindings::interface::{Interface, define_attribute, define_operation,
/// What the implementation of an interface with a maplike declaration, whose keys are strings, implements.
pub(crate) trait Maplike: Interface {
+ fn has(vm: &Vm) -> ThrowCompletionOr<Value> {
+ map_has::<Self>(vm)
+ }
+
// https://webidl.spec.whatwg.org/#dfn-map-entries
fn map_entries(&self, cx: &CallContext) -> Gc<Map>;
diff --git a/Meta/Generators/libweb_bindings/rust_bindings.py b/Meta/Generators/libweb_bindings/rust_bindings.py
index 2f82779c8ca..b534333f34c 100644
--- a/Meta/Generators/libweb_bindings/rust_bindings.py
+++ b/Meta/Generators/libweb_bindings/rust_bindings.py
@@ -966,7 +966,7 @@ def write_rust_collection_properties(out: TextIO, members: RustMembers, defined_
raw_native!(crate::bindings::maplike::map_iterator_values::<Implementation>),
raw_native!(crate::bindings::maplike::map_for_each::<Implementation>),
raw_native!(crate::bindings::maplike::map_get::<Implementation>),
- raw_native!(crate::bindings::maplike::map_has::<Implementation>),
+ raw_native!(<Implementation as crate::bindings::maplike::Maplike>::has),
);
"""
)