2021-12-06 12:26:49 -05:00
|
|
|
/*
|
2022-01-31 13:07:22 -05:00
|
|
|
* Copyright (c) 2021, Tim Flynn <trflynn89@serenityos.org>
|
2021-12-06 12:26:49 -05: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 {
|
|
|
|
|
|
|
|
class DateTimeFormatFunction final : public NativeFunction {
|
|
|
|
JS_OBJECT(DateTimeFormatFunction, NativeFunction);
|
|
|
|
|
|
|
|
public:
|
2022-12-13 20:49:50 +00:00
|
|
|
static NonnullGCPtr<DateTimeFormatFunction> create(Realm&, DateTimeFormat&);
|
2021-12-06 12:26:49 -05:00
|
|
|
|
|
|
|
virtual ~DateTimeFormatFunction() override = default;
|
2023-01-28 12:33:35 -05:00
|
|
|
virtual ThrowCompletionOr<void> initialize(Realm&) override;
|
2021-12-06 12:26:49 -05:00
|
|
|
|
|
|
|
virtual ThrowCompletionOr<Value> call() override;
|
|
|
|
|
|
|
|
private:
|
2022-08-28 23:51:28 +02:00
|
|
|
explicit DateTimeFormatFunction(DateTimeFormat&, Object& prototype);
|
|
|
|
|
2021-12-06 12:26:49 -05:00
|
|
|
virtual void visit_edges(Visitor&) override;
|
|
|
|
|
2023-02-26 16:09:02 -07:00
|
|
|
NonnullGCPtr<DateTimeFormat> m_date_time_format; // [[DateTimeFormat]]
|
2021-12-06 12:26:49 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|