2021-12-06 14:26:49 -03:00
|
|
|
/*
|
2022-01-31 15:07:22 -03:00
|
|
|
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
2021-12-06 14:26:49 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <LibJS/Forward.h>
|
|
|
|
|
#include <LibJS/Runtime/Completion.h>
|
|
|
|
|
#include <LibJS/Runtime/NativeFunction.h>
|
|
|
|
|
|
|
|
|
|
namespace JS::Intl {
|
|
|
|
|
|
2025-07-19 14:41:08 -03:00
|
|
|
class DateTimeFormatFunction final : public NativeFunction {
|
2021-12-06 14:26:49 -03:00
|
|
|
JS_OBJECT(DateTimeFormatFunction, NativeFunction);
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DECLARE_ALLOCATOR(DateTimeFormatFunction);
|
2021-12-06 14:26:49 -03:00
|
|
|
|
|
|
|
|
public:
|
2024-11-14 12:01:23 -03:00
|
|
|
static GC::Ref<DateTimeFormatFunction> create(Realm&, DateTimeFormat&);
|
2021-12-06 14:26:49 -03:00
|
|
|
|
|
|
|
|
virtual ~DateTimeFormatFunction() override = default;
|
2023-08-07 03:41:28 -03:00
|
|
|
virtual void initialize(Realm&) override;
|
2021-12-06 14:26:49 -03:00
|
|
|
|
|
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
|
|
|
|
|
|
|
|
|
private:
|
2022-08-28 18:51:28 -03:00
|
|
|
explicit DateTimeFormatFunction(DateTimeFormat&, Object& prototype);
|
|
|
|
|
|
2021-12-06 14:26:49 -03:00
|
|
|
virtual void visit_edges(Visitor&) override;
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC::Ref<DateTimeFormat> m_date_time_format; // [[DateTimeFormat]]
|
2021-12-06 14:26:49 -03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|