mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:37:36 +00:00
LibJS: Add the Object::define_native_accessor method
This is very similar to Object::define_native_property, but here the native functions are exported as standalone JS getter and setter functions, instead of being transparently called by interactions with the property.
This commit is contained in:
parent
9c5de113b1
commit
7f6d3818a2
2 changed files with 35 additions and 0 deletions
|
@ -95,6 +95,7 @@ public:
|
|||
|
||||
bool define_native_function(const StringOrSymbol& property_name, AK::Function<Value(VM&, GlobalObject&)>, i32 length = 0, PropertyAttributes attributes = default_attributes);
|
||||
bool define_native_property(const StringOrSymbol& property_name, AK::Function<Value(VM&, GlobalObject&)> getter, AK::Function<void(VM&, GlobalObject&, Value)> setter, PropertyAttributes attributes = default_attributes);
|
||||
bool define_native_accessor(StringOrSymbol const& property_name, AK::Function<Value(VM&, GlobalObject&)> getter, AK::Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attributes = default_attributes);
|
||||
|
||||
void define_properties(Value properties);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue