ladybird/Libraries/LibJS/Runtime/BooleanConstructor.h

31 lines
730 B
C
Raw Normal View History

2020-04-06 22:51:16 -05:00
/*
* Copyright (c) 2020, Jack Karamanian <karamanian.jack@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
2020-04-06 22:51:16 -05:00
*/
#pragma once
#include <LibJS/Runtime/NativeFunction.h>
namespace JS {
2020-04-06 22:51:16 -05:00
class BooleanConstructor final : public NativeFunction {
JS_OBJECT(BooleanConstructor, NativeFunction);
GC_DECLARE_ALLOCATOR(BooleanConstructor);
2020-04-06 22:51:16 -05:00
public:
virtual void initialize(Realm&) override;
virtual ~BooleanConstructor() override = default;
2020-04-06 22:51:16 -05:00
virtual ThrowCompletionOr<Value> call() override;
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
2020-04-06 22:51:16 -05:00
private:
explicit BooleanConstructor(Realm&);
2020-04-06 22:51:16 -05:00
virtual bool has_constructor() const override { return true; }
};
2020-04-06 22:51:16 -05:00
}