2022-06-29 18:58:40 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2022, Idan Horowitz <idan.horowitz@serenityos.org>
|
|
|
|
|
*
|
|
|
|
|
* 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 DurationFormatConstructor final : public NativeFunction {
|
2022-06-29 18:58:40 -03:00
|
|
|
JS_OBJECT(DurationFormatConstructor, NativeFunction);
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DECLARE_ALLOCATOR(DurationFormatConstructor);
|
2022-06-29 18:58:40 -03:00
|
|
|
|
|
|
|
|
public:
|
2023-08-07 03:41:28 -03:00
|
|
|
virtual void initialize(Realm&) override;
|
2022-06-29 18:58:40 -03:00
|
|
|
virtual ~DurationFormatConstructor() override = default;
|
|
|
|
|
|
|
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
2024-11-14 12:01:23 -03:00
|
|
|
virtual ThrowCompletionOr<GC::Ref<Object>> construct(FunctionObject& new_target) override;
|
2022-06-29 18:58:40 -03:00
|
|
|
|
|
|
|
|
private:
|
2022-08-28 18:51:28 -03:00
|
|
|
explicit DurationFormatConstructor(Realm&);
|
|
|
|
|
|
2022-06-29 18:58:40 -03:00
|
|
|
virtual bool has_constructor() const override { return true; }
|
2022-06-29 19:25:47 -03:00
|
|
|
|
|
|
|
|
JS_DECLARE_NATIVE_FUNCTION(supported_locales_of);
|
2022-06-29 18:58:40 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|