summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2021-07-22 19:47:07 +0100
committerLinus Groh <mail@linusgroh.de>2021-07-22 21:19:40 +0100
commit4be3196882f592635c4f89c8d2cc9e520418f8e6 (patch)
treebfb910fad3da4beb9d12ab6ec31742eea1069cee /Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h
parent42b6bffbf2b6aa34f4f82cd4c3c34ed5528790ad (diff)
downloadserenity-4be3196882f592635c4f89c8d2cc9e520418f8e6.zip
LibJS: Start implementing Temporal.PlainDateTime
This commit adds the PlainDateTime object itself, its constructor and prototype (currently empty), and the CreateTemporalDateTime abstract operation.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h
new file mode 100644
index 0000000000..a4263ed7ff
--- /dev/null
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/PlainDateTimeConstructor.h
@@ -0,0 +1,28 @@
+/*
+ * Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
+ *
+ * SPDX-License-Identifier: BSD-2-Clause
+ */
+
+#pragma once
+
+#include <LibJS/Runtime/NativeFunction.h>
+
+namespace JS::Temporal {
+
+class PlainDateTimeConstructor final : public NativeFunction {
+ JS_OBJECT(PlainDateTimeConstructor, NativeFunction);
+
+public:
+ explicit PlainDateTimeConstructor(GlobalObject&);
+ virtual void initialize(GlobalObject&) override;
+ virtual ~PlainDateTimeConstructor() override = default;
+
+ virtual Value call() override;
+ virtual Value construct(FunctionObject& new_target) override;
+
+private:
+ virtual bool has_constructor() const override { return true; }
+};
+
+}