summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2021-07-11 21:04:11 +0300
committerLinus Groh <mail@linusgroh.de>2021-07-12 19:05:17 +0100
commitb816037739e323f331f43c33a8eb808cd933c465 (patch)
tree4e18c383da4bdc24a3f7b20b587d83b95e002e31 /Userland/Libraries/LibJS/Runtime/Temporal/Instant.h
parent141c46feda1c91f3b50948749463ecf7c380aa1a (diff)
downloadserenity-b816037739e323f331f43c33a8eb808cd933c465.zip
LibJS: Add the ToTemporalInstant Abstract Operation & its requirements
This is Abstract Operation is required for the majority of InstantConstructor's and InstantPrototype's methods. The implementation is not entirely complete, (specifically 2 of the underlying required abstract operations, ParseTemporalTimeZoneString and ParseISODateTime are missing the required lexing, and as such are TODO()-ed) but the majority of it is done.
Diffstat (limited to 'Userland/Libraries/LibJS/Runtime/Temporal/Instant.h')
-rw-r--r--Userland/Libraries/LibJS/Runtime/Temporal/Instant.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h
index 7700295d93..2c8a0e7871 100644
--- a/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h
+++ b/Userland/Libraries/LibJS/Runtime/Temporal/Instant.h
@@ -1,5 +1,6 @@
/*
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
+ * Copyright (c) 2021, Idan Horowitz <idan.horowitz@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@@ -31,11 +32,13 @@ private:
};
// -86400 * 10^17
-const auto INSTANT_NANOSECONDS_MIN = Crypto::SignedBigInteger::from_base(10, "-8640000000000000000000");
+const auto INSTANT_NANOSECONDS_MIN = "-8640000000000000000000"_sbigint;
// +86400 * 10^17
-const auto INSTANT_NANOSECONDS_MAX = Crypto::SignedBigInteger::from_base(10, "8640000000000000000000");
+const auto INSTANT_NANOSECONDS_MAX = "8640000000000000000000"_sbigint;
bool is_valid_epoch_nanoseconds(BigInt const& epoch_nanoseconds);
-Object* create_temporal_instant(GlobalObject&, BigInt& nanoseconds, FunctionObject* new_target = nullptr);
+Instant* create_temporal_instant(GlobalObject&, BigInt& nanoseconds, FunctionObject* new_target = nullptr);
+Instant* to_temporal_instant(GlobalObject&, Value item);
+BigInt* parse_temporal_instant(GlobalObject&, String const& iso_string);
}