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

LibJS: Convert NativeFunction callback to ThrowCompletionOr

This commit is contained in:
Idan Horowitz 2021-10-19 22:53:27 +03:00 committed by Linus Groh
parent 20163c0584
commit ca27e5eff5
13 changed files with 91 additions and 65 deletions

View file

@ -128,9 +128,13 @@ public:
void define_direct_property(PropertyName const& property_name, Value value, PropertyAttributes attributes) { storage_set(property_name, { value, attributes }); };
void define_direct_accessor(PropertyName const&, FunctionObject* getter, FunctionObject* setter, PropertyAttributes attributes);
// Legacy methods - Remove once JS_DECLARE_OLD_NATIVE_FUNCTION is removed
void define_native_function(PropertyName const&, Function<Value(VM&, GlobalObject&)>, i32 length, PropertyAttributes attributes);
void define_native_accessor(PropertyName const&, Function<Value(VM&, GlobalObject&)> getter, Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attributes);
void define_new_native_function(PropertyName const&, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)>, i32 length, PropertyAttributes attributes);
void define_new_native_accessor(PropertyName const&, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> getter, Function<ThrowCompletionOr<Value>(VM&, GlobalObject&)> setter, PropertyAttributes attributes);
virtual bool is_function() const { return false; }
virtual bool is_typed_array() const { return false; }
virtual bool is_string_object() const { return false; }