CollatorConstructor.h 747 B

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