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
commit fceba6a257
Notes: sideshowbarker 2024-07-17 20:22:04 +09:00
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; }