PlainDateConstructor.h 889 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. * Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
  3. * Copyright (c) 2024, Tim Flynn <trflynn89@ladybird.org>
  4. *
  5. * SPDX-License-Identifier: BSD-2-Clause
  6. */
  7. #pragma once
  8. #include <LibJS/Runtime/NativeFunction.h>
  9. namespace JS::Temporal {
  10. class PlainDateConstructor final : public NativeFunction {
  11. JS_OBJECT(PlainDateConstructor, NativeFunction);
  12. GC_DECLARE_ALLOCATOR(PlainDateConstructor);
  13. public:
  14. virtual void initialize(Realm&) override;
  15. virtual ~PlainDateConstructor() override = default;
  16. virtual ThrowCompletionOr<Value> call() override;
  17. virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
  18. private:
  19. explicit PlainDateConstructor(Realm&);
  20. virtual bool has_constructor() const override { return true; }
  21. JS_DECLARE_NATIVE_FUNCTION(from);
  22. JS_DECLARE_NATIVE_FUNCTION(compare);
  23. };
  24. }