mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:27:44 +00:00
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. :^)
This commit is contained in:
parent
745a1dbb5d
commit
1bd52ce789
15 changed files with 26 additions and 26 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)());
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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<>
|
||||
|
|
|
@ -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))
|
||||
{
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue