PlainYearMonthConstructor.h 856 B

123456789101112131415161718192021222324252627282930313233
  1. /*
  2. * Copyright (c) 2021-2022, Linus Groh <linusg@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibJS/Runtime/NativeFunction.h>
  8. namespace JS::Temporal {
  9. class PlainYearMonthConstructor final : public NativeFunction {
  10. JS_OBJECT(PlainYearMonthConstructor, NativeFunction);
  11. JS_DECLARE_ALLOCATOR(PlainYearMonthConstructor);
  12. public:
  13. virtual void initialize(Realm&) override;
  14. virtual ~PlainYearMonthConstructor() override = default;
  15. virtual ThrowCompletionOr<Value> call() override;
  16. virtual ThrowCompletionOr<NonnullGCPtr<Object>> construct(FunctionObject& new_target) override;
  17. private:
  18. explicit PlainYearMonthConstructor(Realm&);
  19. virtual bool has_constructor() const override { return true; }
  20. JS_DECLARE_NATIVE_FUNCTION(from);
  21. JS_DECLARE_NATIVE_FUNCTION(compare);
  22. };
  23. }