1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:17:34 +00:00

LibJS: Reformat BooleanConstructor.{cpp,h}

This commit is contained in:
Linus Groh 2020-04-07 16:00:44 +01:00 committed by Andreas Kling
parent a31ef54a2a
commit 40ac94995d
2 changed files with 8 additions and 2 deletions

View file

@ -31,13 +31,16 @@
#include <LibJS/Runtime/BooleanPrototype.h>
namespace JS {
BooleanConstructor::BooleanConstructor()
{
put("prototype", Value(interpreter().boolean_prototype()));
put("length", Value(1));
}
BooleanConstructor::~BooleanConstructor() {}
BooleanConstructor::~BooleanConstructor()
{
}
Value BooleanConstructor::call(Interpreter& interpreter)
{
@ -46,7 +49,8 @@ Value BooleanConstructor::call(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);
}
}

View file

@ -29,6 +29,7 @@
#include <LibJS/Runtime/NativeFunction.h>
namespace JS {
class BooleanConstructor final : public NativeFunction {
public:
BooleanConstructor();
@ -41,4 +42,5 @@ private:
virtual bool has_constructor() const override { return true; }
virtual const char* class_name() const override { return "BooleanConstructor"; }
};
}