summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-06-27 21:48:34 +0200
committerAndreas Kling <kling@serenityos.org>2021-06-27 22:36:04 +0200
commitba9d5c4d54d2e58c14eafe1e8960c3832fac46c7 (patch)
tree975cef60a364e12fb5600555548bdb1f8565874e /Userland/Libraries/LibJS/Runtime/BoundFunction.cpp
parente389ae3c9754b0c6c40a383a666f103c42789630 (diff)
downloadserenity-ba9d5c4d54d2e58c14eafe1e8960c3832fac46c7.zip
LibJS: Rename Function => FunctionObject
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/BoundFunction.cpp')
-rw-r--r--Userland/Libraries/LibJS/Runtime/BoundFunction.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp b/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp
index 2f7bf2d114..ef1d77ceef 100644
--- a/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp
+++ b/Userland/Libraries/LibJS/Runtime/BoundFunction.cpp
@@ -9,8 +9,8 @@
namespace JS {
-BoundFunction::BoundFunction(GlobalObject& global_object, Function& target_function, Value bound_this, Vector<Value> arguments, i32 length, Object* constructor_prototype)
- : Function::Function(bound_this, move(arguments), *global_object.function_prototype())
+BoundFunction::BoundFunction(GlobalObject& global_object, FunctionObject& target_function, Value bound_this, Vector<Value> arguments, i32 length, Object* constructor_prototype)
+ : FunctionObject(bound_this, move(arguments), *global_object.function_prototype())
, m_target_function(&target_function)
, m_constructor_prototype(constructor_prototype)
, m_name(String::formatted("bound {}", target_function.name()))
@@ -21,7 +21,7 @@ BoundFunction::BoundFunction(GlobalObject& global_object, Function& target_funct
void BoundFunction::initialize(GlobalObject& global_object)
{
auto& vm = this->vm();
- Function::initialize(global_object);
+ Base::initialize(global_object);
define_property(vm.names.length, Value(m_length), Attribute::Configurable);
}
@@ -34,7 +34,7 @@ Value BoundFunction::call()
return m_target_function->call();
}
-Value BoundFunction::construct(Function& new_target)
+Value BoundFunction::construct(FunctionObject& new_target)
{
if (auto this_value = vm().this_value(global_object()); m_constructor_prototype && this_value.is_object()) {
this_value.as_object().set_prototype(m_constructor_prototype);
@@ -44,14 +44,14 @@ Value BoundFunction::construct(Function& new_target)
return m_target_function->construct(new_target);
}
-FunctionEnvironmentRecord* BoundFunction::create_environment_record(Function& function_being_invoked)
+FunctionEnvironmentRecord* BoundFunction::create_environment_record(FunctionObject& function_being_invoked)
{
return m_target_function->create_environment_record(function_being_invoked);
}
void BoundFunction::visit_edges(Visitor& visitor)
{
- Function::visit_edges(visitor);
+ Base::visit_edges(visitor);
visitor.visit(m_target_function);
visitor.visit(m_constructor_prototype);
}