1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:48:11 +00:00

LibJS: Add Object::may_interfere_with_indexed_property_access() virtual

This function must return true if the object may intercept and customize
access to indexed properties (properties where the property name is a
non-negative integer.)

This will be used to implement fast path optimizations for array-like
accesses in subsequent commits.
This commit is contained in:
Andreas Kling 2023-10-05 08:58:30 +02:00
parent 900334a4aa
commit 7df1692580
12 changed files with 28 additions and 0 deletions

View file

@ -64,6 +64,8 @@ public:
virtual JS::ThrowCompletionOr<bool> internal_delete(JS::PropertyKey const&) override;
virtual JS::ThrowCompletionOr<JS::MarkedVector<JS::Value>> internal_own_property_keys() const override;
virtual bool may_interfere_with_indexed_property_access() const final { return true; }
HTML::CrossOriginPropertyDescriptorMap const& cross_origin_property_descriptor_map() const { return m_cross_origin_property_descriptor_map; }
HTML::CrossOriginPropertyDescriptorMap& cross_origin_property_descriptor_map() { return m_cross_origin_property_descriptor_map; }