2021-08-24 23:27:05 -03:00
|
|
|
/*
|
2022-01-31 15:07:22 -03:00
|
|
|
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
2021-08-24 23:27:05 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
|
|
namespace JS::Intl {
|
|
|
|
|
|
2025-07-19 14:41:08 -03:00
|
|
|
class DisplayNamesConstructor final : public NativeFunction {
|
2021-08-24 23:27:05 -03:00
|
|
|
JS_OBJECT(DisplayNamesConstructor, NativeFunction);
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DECLARE_ALLOCATOR(DisplayNamesConstructor);
|
2021-08-24 23:27:05 -03:00
|
|
|
|
|
|
|
|
public:
|
2023-08-07 03:41:28 -03:00
|
|
|
virtual void initialize(Realm&) override;
|
2021-08-24 23:27:05 -03:00
|
|
|
virtual ~DisplayNamesConstructor() override = default;
|
|
|
|
|
|
2021-10-20 17:16:30 -03:00
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
2024-11-14 12:01:23 -03:00
|
|
|
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
|
2021-08-24 23:27:05 -03:00
|
|
|
|
|
|
|
|
private:
|
2022-08-28 18:51:28 -03:00
|
|
|
explicit DisplayNamesConstructor(Realm&);
|
|
|
|
|
|
2021-08-24 23:27:05 -03:00
|
|
|
virtual bool has_constructor() const override { return true; }
|
2021-09-04 13:08:57 -03:00
|
|
|
|
2021-10-22 18:48:25 -03:00
|
|
|
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
2021-08-24 23:27:05 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|