1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:48:12 +00:00

LibJS: Split more native object constructors into construct/initialize

This commit is contained in:
Andreas Kling 2020-06-20 17:11:11 +02:00
parent 9610d18ebb
commit 06e29fac57
16 changed files with 64 additions and 33 deletions

View file

@ -30,13 +30,18 @@
namespace JS {
BoundFunction::BoundFunction(Function& target_function, Value bound_this, Vector<Value> arguments, i32 length, Object* constructor_prototype)
: Function::Function(*interpreter().global_object().function_prototype(), bound_this, move(arguments))
BoundFunction::BoundFunction(GlobalObject& global_object, Function& target_function, Value bound_this, Vector<Value> arguments, i32 length, Object* constructor_prototype)
: Function::Function(*global_object.function_prototype(), bound_this, move(arguments))
, m_target_function(&target_function)
, m_constructor_prototype(constructor_prototype)
, m_name(String::format("bound %s", target_function.name().characters()))
, m_length(length)
{
define_property("length", Value(length), Attribute::Configurable);
}
void BoundFunction::initialize(Interpreter&, GlobalObject&)
{
define_property("length", Value(m_length), Attribute::Configurable);
}
BoundFunction::~BoundFunction()