mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS: Virtualize access to an Object's own properties
Object now has virtual get_own_property() and put_own_property() member functions that can be overridden to provide custom behavior. We use these virtuals to move Array-specific access behavior to Array.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 08:12:17 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/324b92fd061
@@ -45,6 +45,8 @@ private:
|
||||
virtual const char* class_name() const override { return "Array"; }
|
||||
virtual void visit_children(Cell::Visitor&) override;
|
||||
virtual bool is_array() const override { return true; }
|
||||
virtual Optional<Value> get_own_property(const String& property_name) const override;
|
||||
virtual bool put_own_property(const String& property_name, Value) override;
|
||||
|
||||
Vector<Value> m_elements;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user