mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:37:43 +00:00
LibJS: Reformat BooleanConstructor.{cpp,h}
This commit is contained in:
parent
a31ef54a2a
commit
40ac94995d
2 changed files with 8 additions and 2 deletions
|
@ -31,13 +31,16 @@
|
||||||
#include <LibJS/Runtime/BooleanPrototype.h>
|
#include <LibJS/Runtime/BooleanPrototype.h>
|
||||||
|
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
BooleanConstructor::BooleanConstructor()
|
BooleanConstructor::BooleanConstructor()
|
||||||
{
|
{
|
||||||
put("prototype", Value(interpreter().boolean_prototype()));
|
put("prototype", Value(interpreter().boolean_prototype()));
|
||||||
put("length", Value(1));
|
put("length", Value(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
BooleanConstructor::~BooleanConstructor() {}
|
BooleanConstructor::~BooleanConstructor()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
Value BooleanConstructor::call(Interpreter& interpreter)
|
Value BooleanConstructor::call(Interpreter& interpreter)
|
||||||
{
|
{
|
||||||
|
@ -46,7 +49,8 @@ Value BooleanConstructor::call(Interpreter& interpreter)
|
||||||
|
|
||||||
Value BooleanConstructor::construct(Interpreter& interpreter)
|
Value BooleanConstructor::construct(Interpreter& interpreter)
|
||||||
{
|
{
|
||||||
auto bool_object = interpreter.heap().allocate<BooleanObject>(interpreter.argument(0).to_boolean());
|
auto* bool_object = interpreter.heap().allocate<BooleanObject>(interpreter.argument(0).to_boolean());
|
||||||
return Value(bool_object);
|
return Value(bool_object);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <LibJS/Runtime/NativeFunction.h>
|
#include <LibJS/Runtime/NativeFunction.h>
|
||||||
|
|
||||||
namespace JS {
|
namespace JS {
|
||||||
|
|
||||||
class BooleanConstructor final : public NativeFunction {
|
class BooleanConstructor final : public NativeFunction {
|
||||||
public:
|
public:
|
||||||
BooleanConstructor();
|
BooleanConstructor();
|
||||||
|
@ -41,4 +42,5 @@ private:
|
||||||
virtual bool has_constructor() const override { return true; }
|
virtual bool has_constructor() const override { return true; }
|
||||||
virtual const char* class_name() const override { return "BooleanConstructor"; }
|
virtual const char* class_name() const override { return "BooleanConstructor"; }
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue