diff options
author | Andreas Kling <kling@serenityos.org> | 2021-06-27 22:38:42 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-06-27 22:40:49 +0200 |
commit | 1bd52ce7896889f24c5972408c6b29b3d5ebde1d (patch) | |
tree | 8445777cb206e571dd438e9ea119b4bb65941e5e /Userland | |
parent | 745a1dbb5dc7201b991bed5afa24892b07dab5f9 (diff) | |
download | serenity-1bd52ce7896889f24c5972408c6b29b3d5ebde1d.zip |
LibJS: Stop qualifying AK::Function
Now that JS function objects are JS::FunctionObject, we can stop
qualifying AK::Function and just say "Function" everywhere. Nice. :^)
Diffstat (limited to 'Userland')
15 files changed, 26 insertions, 26 deletions
diff --git a/Userland/Libraries/LibJS/Bytecode/Pass/PlaceBlocks.cpp b/Userland/Libraries/LibJS/Bytecode/Pass/PlaceBlocks.cpp index 4a320ac470..a9b925f301 100644 --- a/Userland/Libraries/LibJS/Bytecode/Pass/PlaceBlocks.cpp +++ b/Userland/Libraries/LibJS/Bytecode/Pass/PlaceBlocks.cpp @@ -19,7 +19,7 @@ void PlaceBlocks::perform(PassPipelineExecutable& executable) HashTable<BasicBlock const*> reachable_blocks; // Visit the blocks in CFG order - AK::Function<void(BasicBlock const*)> visit = [&](auto* block) { + Function<void(BasicBlock const*)> visit = [&](auto* block) { if (reachable_blocks.contains(block)) return; diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp index 85b7c4566b..9bd057ec8d 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.cpp @@ -50,7 +50,7 @@ size_t length_of_array_like(GlobalObject& global_object, Object const& object) } // 7.3.19 CreateListFromArrayLike ( obj [ , elementTypes ] ), https://tc39.es/ecma262/#sec-createlistfromarraylike -MarkedValueList create_list_from_array_like(GlobalObject& global_object, Value value, AK::Function<Result<void, ErrorType>(Value)> check_value) +MarkedValueList create_list_from_array_like(GlobalObject& global_object, Value value, Function<Result<void, ErrorType>(Value)> check_value) { auto& vm = global_object.vm(); auto& heap = global_object.heap(); diff --git a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h index acb63780fe..7cd70f8ead 100644 --- a/Userland/Libraries/LibJS/Runtime/AbstractOperations.h +++ b/Userland/Libraries/LibJS/Runtime/AbstractOperations.h @@ -19,7 +19,7 @@ EnvironmentRecord& get_this_environment(VM&); Object* get_super_constructor(VM&); Value require_object_coercible(GlobalObject&, Value); size_t length_of_array_like(GlobalObject&, Object const&); -MarkedValueList create_list_from_array_like(GlobalObject&, Value, AK::Function<Result<void, ErrorType>(Value)> = {}); +MarkedValueList create_list_from_array_like(GlobalObject&, Value, Function<Result<void, ErrorType>(Value)> = {}); FunctionObject* species_constructor(GlobalObject&, Object const&, FunctionObject& default_constructor); GlobalObject* get_function_realm(GlobalObject&, FunctionObject const&); Object* get_prototype_from_constructor(GlobalObject&, FunctionObject const& constructor, Object* (GlobalObject::*intrinsic_default_prototype)()); diff --git a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp index e9c31b979c..72b47a5ed8 100644 --- a/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/ArrayPrototype.cpp @@ -110,7 +110,7 @@ static FunctionObject* callback_from_args(GlobalObject& global_object, const Str return &callback.as_function(); } -static void for_each_item(VM& vm, GlobalObject& global_object, const String& name, AK::Function<IterationDecision(size_t index, Value value, Value callback_result)> callback, bool skip_empty = true) +static void for_each_item(VM& vm, GlobalObject& global_object, const String& name, Function<IterationDecision(size_t index, Value value, Value callback_result)> callback, bool skip_empty = true) { auto* this_object = vm.this_value(global_object).to_object(global_object); if (!this_object) diff --git a/Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp b/Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp index 1cf6b76152..0e934e06c0 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp +++ b/Userland/Libraries/LibJS/Runtime/IteratorOperations.cpp @@ -143,7 +143,7 @@ MarkedValueList iterable_to_list(GlobalObject& global_object, Value iterable, Va return values; } -void get_iterator_values(GlobalObject& global_object, Value value, AK::Function<IterationDecision(Value)> callback, Value method, CloseOnAbrupt close_on_abrupt) +void get_iterator_values(GlobalObject& global_object, Value value, Function<IterationDecision(Value)> callback, Value method, CloseOnAbrupt close_on_abrupt) { auto& vm = global_object.vm(); diff --git a/Userland/Libraries/LibJS/Runtime/IteratorOperations.h b/Userland/Libraries/LibJS/Runtime/IteratorOperations.h index 8afcbda067..0fe9a8ef21 100644 --- a/Userland/Libraries/LibJS/Runtime/IteratorOperations.h +++ b/Userland/Libraries/LibJS/Runtime/IteratorOperations.h @@ -30,6 +30,6 @@ enum class CloseOnAbrupt { No, Yes }; -void get_iterator_values(GlobalObject&, Value value, AK::Function<IterationDecision(Value)> callback, Value method = {}, CloseOnAbrupt close_on_abrupt = CloseOnAbrupt::Yes); +void get_iterator_values(GlobalObject&, Value value, Function<IterationDecision(Value)> callback, Value method = {}, CloseOnAbrupt close_on_abrupt = CloseOnAbrupt::Yes); } diff --git a/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp b/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp index 0933d3a420..61764b9b5b 100644 --- a/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp +++ b/Userland/Libraries/LibJS/Runtime/NativeFunction.cpp @@ -10,7 +10,7 @@ namespace JS { -NativeFunction* NativeFunction::create(GlobalObject& global_object, const FlyString& name, AK::Function<Value(VM&, GlobalObject&)> function) +NativeFunction* NativeFunction::create(GlobalObject& global_object, const FlyString& name, Function<Value(VM&, GlobalObject&)> function) { return global_object.heap().allocate<NativeFunction>(global_object, name, move(function), *global_object.function_prototype()); } @@ -20,7 +20,7 @@ NativeFunction::NativeFunction(Object& prototype) { } -NativeFunction::NativeFunction(PropertyName const& name, AK::Function<Value(VM&, GlobalObject&)> native_function, Object& prototype) +NativeFunction::NativeFunction(PropertyName const& name, Function<Value(VM&, GlobalObject&)> native_function, Object& prototype) : FunctionObject(prototype) , m_name(name.as_string()) , m_native_function(move(native_function)) diff --git a/Userland/Libraries/LibJS/Runtime/NativeFunction.h b/Userland/Libraries/LibJS/Runtime/NativeFunction.h index fcff8a55e9..40415d8161 100644 --- a/Userland/Libraries/LibJS/Runtime/NativeFunction.h +++ b/Userland/Libraries/LibJS/Runtime/NativeFunction.h @@ -15,9 +15,9 @@ class NativeFunction : public FunctionObject { JS_OBJECT(NativeFunction, FunctionObject); public: - static NativeFunction* create(GlobalObject&, const FlyString& name, AK::Function<Value(VM&, GlobalObject&)>); + static NativeFunction* create(GlobalObject&, const FlyString& name, Function<Value(VM&, GlobalObject&)>); - explicit NativeFunction(PropertyName const& name, AK::Function<Value(VM&, GlobalObject&)>, Object& prototype); + explicit NativeFunction(PropertyName const& name, Function<Value(VM&, GlobalObject&)>, Object& prototype); virtual void initialize(GlobalObject&) override { } virtual ~NativeFunction() override; @@ -38,7 +38,7 @@ private: virtual bool is_native_function() const final { return true; } FlyString m_name; - AK::Function<Value(VM&, GlobalObject&)> m_native_function; + Function<Value(VM&, GlobalObject&)> m_native_function; }; template<> diff --git a/Userland/Libraries/LibJS/Runtime/NativeProperty.cpp b/Userland/Libraries/LibJS/Runtime/NativeProperty.cpp index 475f808c46..47c9857e8a 100644 --- a/Userland/Libraries/LibJS/Runtime/NativeProperty.cpp +++ b/Userland/Libraries/LibJS/Runtime/NativeProperty.cpp @@ -9,7 +9,7 @@ namespace JS { -NativeProperty::NativeProperty(AK::Function<Value(VM&, GlobalObject&)> getter, AK::Function<void(VM&, GlobalObject&, Value)> setter) +NativeProperty::NativeProperty(Function<Value(VM&, GlobalObject&)> getter, Function<void(VM&, GlobalObject&, Value)> setter) : m_getter(move(getter)) , m_setter(move(setter)) { diff --git a/Userland/Libraries/LibJS/Runtime/NativeProperty.h b/Userland/Libraries/LibJS/Runtime/NativeProperty.h index 1498a31924..aaa0389b5e 100644 --- a/Userland/Libraries/LibJS/Runtime/NativeProperty.h +++ b/Userland/Libraries/LibJS/Runtime/NativeProperty.h @@ -13,7 +13,7 @@ namespace JS { class NativeProperty final : public Cell { public: - NativeProperty(AK::Function<Value(VM&, GlobalObject&)> getter, AK::Function<void(VM&, GlobalObject&, Value)> setter); + NativeProperty(Function<Value(VM&, GlobalObject&)> getter, Function<void(VM&, GlobalObject&, Value)> setter); virtual ~NativeProperty() override; Value get(VM&, GlobalObject&) const; @@ -22,8 +22,8 @@ public: private: virtual const char* class_name() const override { return "NativeProperty"; } - AK::Function<Value(VM&, GlobalObject&)> m_getter; - AK::Function<void(VM&, GlobalObject&, Value)> m_setter; + Function<Value(VM&, GlobalObject&)> m_getter; + Function<void(VM&, GlobalObject&, Value)> m_setter; }; } diff --git a/Userland/Libraries/LibJS/Runtime/Object.cpp b/Userland/Libraries/LibJS/Runtime/Object.cpp index e67fc69379..bc71c2ef31 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.cpp +++ b/Userland/Libraries/LibJS/Runtime/Object.cpp @@ -555,7 +555,7 @@ bool Object::define_property(const PropertyName& property_name, Value value, Pro return put_own_property(property_name.to_string_or_symbol(), value, attributes, PutOwnPropertyMode::DefineProperty, throw_exceptions); } -bool Object::define_native_accessor(PropertyName const& property_name, AK::Function<Value(VM&, GlobalObject&)> getter, AK::Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attribute) +bool Object::define_native_accessor(PropertyName const& property_name, Function<Value(VM&, GlobalObject&)> getter, Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attribute) { auto& vm = this->vm(); String formatted_property_name; @@ -990,7 +990,7 @@ bool Object::put(const PropertyName& property_name, Value value, Value receiver) return put_own_property(string_or_symbol, value, default_attributes, PutOwnPropertyMode::Put, vm().in_strict_mode()); } -bool Object::define_native_function(PropertyName const& property_name, AK::Function<Value(VM&, GlobalObject&)> native_function, i32 length, PropertyAttributes attribute) +bool Object::define_native_function(PropertyName const& property_name, Function<Value(VM&, GlobalObject&)> native_function, i32 length, PropertyAttributes attribute) { auto& vm = this->vm(); String function_name; @@ -1009,7 +1009,7 @@ bool Object::define_native_function(PropertyName const& property_name, AK::Funct return define_property(property_name, function, attribute); } -bool Object::define_native_property(PropertyName const& property_name, AK::Function<Value(VM&, GlobalObject&)> getter, AK::Function<void(VM&, GlobalObject&, Value)> setter, PropertyAttributes attribute) +bool Object::define_native_property(PropertyName const& property_name, Function<Value(VM&, GlobalObject&)> getter, Function<void(VM&, GlobalObject&, Value)> setter, PropertyAttributes attribute) { return define_property(property_name, heap().allocate_without_global_object<NativeProperty>(move(getter), move(setter)), attribute); } diff --git a/Userland/Libraries/LibJS/Runtime/Object.h b/Userland/Libraries/LibJS/Runtime/Object.h index 5c27c82f08..ea6b05ab37 100644 --- a/Userland/Libraries/LibJS/Runtime/Object.h +++ b/Userland/Libraries/LibJS/Runtime/Object.h @@ -93,9 +93,9 @@ public: bool define_property_without_transition(const PropertyName&, Value value, PropertyAttributes attributes = default_attributes, bool throw_exceptions = true); bool define_accessor(const PropertyName&, FunctionObject* getter, FunctionObject* setter, PropertyAttributes attributes = default_attributes, bool throw_exceptions = true); - bool define_native_function(PropertyName const&, AK::Function<Value(VM&, GlobalObject&)>, i32 length = 0, PropertyAttributes attributes = default_attributes); - bool define_native_property(PropertyName const&, AK::Function<Value(VM&, GlobalObject&)> getter, AK::Function<void(VM&, GlobalObject&, Value)> setter, PropertyAttributes attributes = default_attributes); - bool define_native_accessor(PropertyName const&, AK::Function<Value(VM&, GlobalObject&)> getter, AK::Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attributes = default_attributes); + bool define_native_function(PropertyName const&, Function<Value(VM&, GlobalObject&)>, i32 length = 0, PropertyAttributes attributes = default_attributes); + bool define_native_property(PropertyName const&, Function<Value(VM&, GlobalObject&)> getter, Function<void(VM&, GlobalObject&, Value)> setter, PropertyAttributes attributes = default_attributes); + bool define_native_accessor(PropertyName const&, Function<Value(VM&, GlobalObject&)> getter, Function<Value(VM&, GlobalObject&)> setter, PropertyAttributes attributes = default_attributes); void define_properties(Value properties); diff --git a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h index 9d5a09315a..f15fc6efea 100644 --- a/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h +++ b/Userland/Libraries/LibJS/Runtime/PromiseResolvingFunction.h @@ -25,7 +25,7 @@ class PromiseResolvingFunction final : public NativeFunction { JS_OBJECT(PromiseResolvingFunction, NativeFunction); public: - using FunctionType = AK::Function<Value(VM&, GlobalObject&, Promise&, AlreadyResolved&)>; + using FunctionType = Function<Value(VM&, GlobalObject&, Promise&, AlreadyResolved&)>; static PromiseResolvingFunction* create(GlobalObject&, Promise&, AlreadyResolved&, FunctionType); diff --git a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp index 0a9e77bc2e..d8dd57f46c 100644 --- a/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/TypedArrayPrototype.cpp @@ -80,7 +80,7 @@ static FunctionObject* callback_from_args(GlobalObject& global_object, const Str return &callback.as_function(); } -static void for_each_item(VM& vm, GlobalObject& global_object, const String& name, AK::Function<IterationDecision(size_t index, Value value, Value callback_result)> callback) +static void for_each_item(VM& vm, GlobalObject& global_object, const String& name, Function<IterationDecision(size_t index, Value value, Value callback_result)> callback) { auto* typed_array = typed_array_from(vm, global_object); if (!typed_array) diff --git a/Userland/Libraries/LibJS/Runtime/VM.h b/Userland/Libraries/LibJS/Runtime/VM.h index 22f3692814..1f8698c67a 100644 --- a/Userland/Libraries/LibJS/Runtime/VM.h +++ b/Userland/Libraries/LibJS/Runtime/VM.h @@ -252,9 +252,9 @@ public: void promise_rejection_tracker(const Promise&, Promise::RejectionOperation) const; - AK::Function<void()> on_call_stack_emptied; - AK::Function<void(const Promise&)> on_promise_unhandled_rejection; - AK::Function<void(const Promise&)> on_promise_rejection_handled; + Function<void()> on_call_stack_emptied; + Function<void(const Promise&)> on_promise_unhandled_rejection; + Function<void(const Promise&)> on_promise_rejection_handled; private: VM(); |