mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-06 16:45:03 +00: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:
@@ -40,8 +40,11 @@ public:
|
||||
Object();
|
||||
virtual ~Object();
|
||||
|
||||
Value get(String property_name) const;
|
||||
void put(String property_name, Value);
|
||||
Value get(const String& property_name) const;
|
||||
void put(const String& property_name, Value);
|
||||
|
||||
virtual Optional<Value> get_own_property(const String& property_name) const;
|
||||
virtual bool put_own_property(const String& property_name, Value);
|
||||
|
||||
void put_native_function(String property_name, AK::Function<Value(Object*, Vector<Value>)>);
|
||||
void put_native_property(String property_name, AK::Function<Value(Object*)> getter, AK::Function<void(Object*, Value)> setter);
|
||||
|
||||
Reference in New Issue
Block a user