1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:27:43 +00:00

LibWeb/WebIDL: Introduce ObservableArray

ObservableArray inherits from JS::Array and overrides `internal_set`
and `internal_delete` to run an interceptor callback when an indexed
item is added or deleted.
This commit is contained in:
Aliaksandr Kalenik 2024-03-07 23:29:25 +01:00 committed by Andreas Kling
parent 75a8d37c99
commit fceba6a257
4 changed files with 114 additions and 1 deletions

View file

@ -44,7 +44,7 @@ public:
virtual ThrowCompletionOr<Optional<PropertyDescriptor>> internal_get_own_property(PropertyKey const&) const override final;
virtual ThrowCompletionOr<bool> internal_define_own_property(PropertyKey const&, PropertyDescriptor const&) override final;
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override final;
virtual ThrowCompletionOr<bool> internal_delete(PropertyKey const&) override;
virtual ThrowCompletionOr<MarkedVector<Value>> internal_own_property_keys() const override final;
[[nodiscard]] bool length_is_writable() const { return m_length_writable; }