LibJS: Use Function as callback type in define_native_function/accessor
There is not need to use SafeFunction because define_native_function or define_native_accessor will pass callback forward to NativeFunction that uses HeapFunction to visit it.
This commit is contained in:
parent
84f845494e
commit
3a1f617fbf
Notes:
sideshowbarker
2024-07-16 21:42:29 +09:00
Author: https://github.com/kalenikaliaksandr Commit: https://github.com/SerenityOS/serenity/commit/3a1f617fbf Pull-request: https://github.com/SerenityOS/serenity/pull/21242
2 changed files with 4 additions and 4 deletions
|
@ -1197,7 +1197,7 @@ void Object::set_prototype(Object* new_prototype)
|
|||
m_shape = shape.create_prototype_transition(new_prototype);
|
||||
}
|
||||
|
||||
void Object::define_native_accessor(Realm& realm, PropertyKey const& property_key, SafeFunction<ThrowCompletionOr<Value>(VM&)> getter, SafeFunction<ThrowCompletionOr<Value>(VM&)> setter, PropertyAttributes attribute)
|
||||
void Object::define_native_accessor(Realm& realm, PropertyKey const& property_key, Function<ThrowCompletionOr<Value>(VM&)> getter, Function<ThrowCompletionOr<Value>(VM&)> setter, PropertyAttributes attribute)
|
||||
{
|
||||
FunctionObject* getter_function = nullptr;
|
||||
if (getter)
|
||||
|
@ -1257,7 +1257,7 @@ Value Object::get_without_side_effects(PropertyKey const& property_key) const
|
|||
return {};
|
||||
}
|
||||
|
||||
void Object::define_native_function(Realm& realm, PropertyKey const& property_key, SafeFunction<ThrowCompletionOr<Value>(VM&)> native_function, i32 length, PropertyAttributes attribute)
|
||||
void Object::define_native_function(Realm& realm, PropertyKey const& property_key, Function<ThrowCompletionOr<Value>(VM&)> native_function, i32 length, PropertyAttributes attribute)
|
||||
{
|
||||
auto function = NativeFunction::create(realm, move(native_function), length, property_key, &realm);
|
||||
define_direct_property(property_key, function, attribute);
|
||||
|
|
|
@ -166,8 +166,8 @@ public:
|
|||
using IntrinsicAccessor = Value (*)(Realm&);
|
||||
void define_intrinsic_accessor(PropertyKey const&, PropertyAttributes attributes, IntrinsicAccessor accessor);
|
||||
|
||||
void define_native_function(Realm&, PropertyKey const&, SafeFunction<ThrowCompletionOr<Value>(VM&)>, i32 length, PropertyAttributes attributes);
|
||||
void define_native_accessor(Realm&, PropertyKey const&, SafeFunction<ThrowCompletionOr<Value>(VM&)> getter, SafeFunction<ThrowCompletionOr<Value>(VM&)> setter, PropertyAttributes attributes);
|
||||
void define_native_function(Realm&, PropertyKey const&, Function<ThrowCompletionOr<Value>(VM&)>, i32 length, PropertyAttributes attributes);
|
||||
void define_native_accessor(Realm&, PropertyKey const&, Function<ThrowCompletionOr<Value>(VM&)> getter, Function<ThrowCompletionOr<Value>(VM&)> setter, PropertyAttributes attributes);
|
||||
|
||||
virtual bool is_dom_node() const { return false; }
|
||||
virtual bool is_function() const { return false; }
|
||||
|
|
Loading…
Add table
Reference in a new issue