1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 05:57:45 +00:00

LibJS: Remove the NativeProperty mechanism from LibJS

These were an ad-hoc way to implement special behaviour when reading or
writing to specific object properties. Because these were effectively
replaced by the abillity to override the internal methods of Object,
they are no longer needed.
This commit is contained in:
Idan Horowitz 2021-07-07 19:34:26 +03:00 committed by Linus Groh
parent 306d59276a
commit 795786387b
11 changed files with 9 additions and 157 deletions

View file

@ -111,12 +111,7 @@ public:
// Implementation-specific storage abstractions
enum class CallNativeProperty {
Yes,
No,
};
Optional<ValueAndAttributes> storage_get(PropertyName const&, CallNativeProperty = CallNativeProperty::Yes) const;
Optional<ValueAndAttributes> storage_get(PropertyName const&) const;
bool storage_has(PropertyName const&) const;
void storage_set(PropertyName const&, ValueAndAttributes const&);
void storage_delete(PropertyName const&);
@ -129,7 +124,6 @@ public:
void define_direct_accessor(PropertyName const&, FunctionObject* getter, FunctionObject* setter, PropertyAttributes attributes);
void define_native_function(PropertyName const&, Function<Value(VM&, GlobalObject&)>, i32 length, PropertyAttributes attributes);
void define_native_property(PropertyName const&, Function<Value(VM&, GlobalObject&)> getter, Function<void(VM&, GlobalObject&, Value)> setter, PropertyAttributes attributes);
void define_native_accessor(PropertyName const&, Function<Value(VM&, GlobalObject&)> getter, Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attributes);
virtual bool is_function() const { return false; }
@ -196,9 +190,6 @@ protected:
bool m_has_parameter_map { false };
private:
Value call_native_property_getter(NativeProperty& property, Value this_value) const;
void call_native_property_setter(NativeProperty& property, Value this_value, Value) const;
void set_shape(Shape&);
Object* prototype() { return shape().prototype(); }