2022-01-28 12:56:04 -05:00
|
|
|
/*
|
2024-06-14 14:15:28 -04:00
|
|
|
* Copyright (c) 2022-2024, Tim Flynn <trflynn89@serenityos.org>
|
2022-01-28 12:56:04 -05:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
|
|
namespace JS::Intl {
|
|
|
|
|
|
|
|
|
|
class PluralRulesConstructor final : public NativeFunction {
|
|
|
|
|
JS_OBJECT(PluralRulesConstructor, NativeFunction);
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DECLARE_ALLOCATOR(PluralRulesConstructor);
|
2022-01-28 12:56:04 -05:00
|
|
|
|
|
|
|
|
public:
|
2023-08-07 08:41:28 +02:00
|
|
|
virtual void initialize(Realm&) override;
|
2022-01-28 12:56:04 -05:00
|
|
|
virtual ~PluralRulesConstructor() override = default;
|
|
|
|
|
|
|
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
2024-11-15 04:01:23 +13:00
|
|
|
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
|
2022-01-28 12:56:04 -05:00
|
|
|
|
|
|
|
|
private:
|
2022-08-28 23:51:28 +02:00
|
|
|
explicit PluralRulesConstructor(Realm&);
|
|
|
|
|
|
2022-01-28 12:56:04 -05:00
|
|
|
virtual bool has_constructor() const override { return true; }
|
2022-01-28 13:31:04 -05:00
|
|
|
|
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
2022-01-28 12:56:04 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|